# HG changeset patch # User Maxim Dounin # Date 1328884264 0 # Node ID 6299d1c4dbb4e3864ca8150e7d2816e0d4399ebe # Parent ccb2f8e3d08d412a994f6f17f3716733125b367a 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. diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1591,7 +1591,7 @@ ngx_http_upstream_process_header(ngx_htt 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");