comparison src/http/ngx_http_upstream.c @ 4507:e66122a62bde stable-1.0

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 05 Mar 2012 12:15:02 +0000
parents 4919fb357a5d
children 8e24fb8ee3e7
comparison
equal deleted inserted replaced
4506:14f8e8a0cc77 4507:e66122a62bde
1559 1559
1560 rc = u->process_header(r); 1560 rc = u->process_header(r);
1561 1561
1562 if (rc == NGX_AGAIN) { 1562 if (rc == NGX_AGAIN) {
1563 1563
1564 if (u->buffer.pos == u->buffer.end) { 1564 if (u->buffer.last == u->buffer.end) {
1565 ngx_log_error(NGX_LOG_ERR, c->log, 0, 1565 ngx_log_error(NGX_LOG_ERR, c->log, 0,
1566 "upstream sent too big header"); 1566 "upstream sent too big header");
1567 1567
1568 ngx_http_upstream_next(r, u, 1568 ngx_http_upstream_next(r, u,
1569 NGX_HTTP_UPSTREAM_FT_INVALID_HEADER); 1569 NGX_HTTP_UPSTREAM_FT_INVALID_HEADER);