diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2012-03-05 12:15:02 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-03-05 12:15:02 +0000 |
commit | 27b9a05b4b957adc5a7d87e5d0baebbec9dc26e6 (patch) | |
tree | 318e8b69e65fb782c6d528702ad040e9cb3b7e6b | |
parent | 9ec45d5f6fde95be4a19669d631044cfe7b52cb6 (diff) | |
download | nginx-27b9a05b4b957adc5a7d87e5d0baebbec9dc26e6.tar.gz |
Merge of r4461: 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.
-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 d4f50a368..377e10ffb 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1561,7 +1561,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"); |