Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 4460:6299d1c4dbb4
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 10 Feb 2012 14:31:04 +0000 |
parents | d620f497c50f |
children | 7bf3b68239a3 |
comparison
equal
deleted
inserted
replaced
4459:ccb2f8e3d08d | 4460:6299d1c4dbb4 |
---|---|
1589 | 1589 |
1590 rc = u->process_header(r); | 1590 rc = u->process_header(r); |
1591 | 1591 |
1592 if (rc == NGX_AGAIN) { | 1592 if (rc == NGX_AGAIN) { |
1593 | 1593 |
1594 if (u->buffer.pos == u->buffer.end) { | 1594 if (u->buffer.last == u->buffer.end) { |
1595 ngx_log_error(NGX_LOG_ERR, c->log, 0, | 1595 ngx_log_error(NGX_LOG_ERR, c->log, 0, |
1596 "upstream sent too big header"); | 1596 "upstream sent too big header"); |
1597 | 1597 |
1598 ngx_http_upstream_next(r, u, | 1598 ngx_http_upstream_next(r, u, |
1599 NGX_HTTP_UPSTREAM_FT_INVALID_HEADER); | 1599 NGX_HTTP_UPSTREAM_FT_INVALID_HEADER); |