diff options
| author | Valentin Bartenev <vbart@nginx.com> | 2014-05-15 19:22:06 +0400 |
|---|---|---|
| committer | Valentin Bartenev <vbart@nginx.com> | 2014-05-15 19:22:06 +0400 |
| commit | d51d16806679459e5aa259049e72164d7e928838 (patch) | |
| tree | dca4d869e208471b7bc2dc5a7f0502863bde8746 /src | |
| parent | ef51079fe287b4cd618a1956529990ca6fefec47 (diff) | |
| download | nginx-d51d16806679459e5aa259049e72164d7e928838.tar.gz nginx-d51d16806679459e5aa259049e72164d7e928838.tar.bz2 | |
SPDY: set log action for PROXY protocol only while parsing it.
Handling of PROXY protocol for SPDY connection is currently implemented as
a SPDY state. And while nginx waiting for PROXY protocol data it continues
to process SPDY connection: initializes zlib context, sends control frames.
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/ngx_http_spdy.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c index 7b6996f2a..39bd6d370 100644 --- a/src/http/ngx_http_spdy.c +++ b/src/http/ngx_http_spdy.c @@ -424,12 +424,8 @@ ngx_http_spdy_init(ngx_event_t *rev) sc->init_window = NGX_SPDY_INIT_STREAM_WINDOW; - sc->handler = ngx_http_spdy_state_head; - - if (hc->proxy_protocol) { - c->log->action = "reading PROXY protocol"; - sc->handler = ngx_http_spdy_proxy_protocol; - } + sc->handler = hc->proxy_protocol ? ngx_http_spdy_proxy_protocol + : ngx_http_spdy_state_head; sc->zstream_in.zalloc = ngx_http_spdy_zalloc; sc->zstream_in.zfree = ngx_http_spdy_zfree; @@ -823,14 +819,19 @@ static u_char * ngx_http_spdy_proxy_protocol(ngx_http_spdy_connection_t *sc, u_char *pos, u_char *end) { + ngx_log_t *log; + + log = sc->connection->log; + log->action = "reading PROXY protocol"; + pos = ngx_proxy_protocol_parse(sc->connection, pos, end); + log->action = "processing SPDY"; + if (pos == NULL) { return ngx_http_spdy_state_protocol_error(sc); } - sc->connection->log->action = "processing SPDY"; - return ngx_http_spdy_state_complete(sc, pos, end); } |
