diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2012-02-10 14:31:04 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-02-10 14:31:04 +0000 |
commit | 060b92451bc71c1f4dc1c7d5fdadf4ba69e3539d (patch) | |
tree | 43c2f7fe83e92d565bcdde1633d3397be17cb8ec /src | |
parent | 891b43db32ad7b21bc9e37f42751cb6fc85a3a73 (diff) | |
download | nginx-060b92451bc71c1f4dc1c7d5fdadf4ba69e3539d.tar.gz nginx-060b92451bc71c1f4dc1c7d5fdadf4ba69e3539d.zip |
Upstream: fixed "too big header" check.
If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer. This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.
Patch by Feibo Li.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_upstream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index ba21c0135..577c2b563 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1591,7 +1591,7 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u) if (rc == NGX_AGAIN) { - if (u->buffer.pos == u->buffer.end) { + if (u->buffer.last == u->buffer.end) { ngx_log_error(NGX_LOG_ERR, c->log, 0, "upstream sent too big header"); |