Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 5301:a50e26148d21
Upstream: added check if a response is complete.
Checks were added to both buffered and unbuffered code paths to detect
and complain if a response is incomplete. Appropriate error codes are
now passed to ngx_http_upstream_finalize_request().
With this change in unbuffered mode we now use u->length set to -1 as an
indicator that EOF is allowed per protocol and used to indicate response
end (much like its with p->length in buffered mode). Proxy module was
changed to set u->length to 1 (instead of previously used -1) in case of
chunked transfer encoding used to comply with the above.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 25 Jul 2013 15:00:12 +0400 |
parents | 05c53652e7b4 |
children | 2fda9065d0f4 |
comparison
equal
deleted
inserted
replaced
5300:f538a67c9f77 | 5301:a50e26148d21 |
---|---|
1540 | 1540 |
1541 u->pipe->input_filter = ngx_http_proxy_chunked_filter; | 1541 u->pipe->input_filter = ngx_http_proxy_chunked_filter; |
1542 u->pipe->length = 3; /* "0" LF LF */ | 1542 u->pipe->length = 3; /* "0" LF LF */ |
1543 | 1543 |
1544 u->input_filter = ngx_http_proxy_non_buffered_chunked_filter; | 1544 u->input_filter = ngx_http_proxy_non_buffered_chunked_filter; |
1545 u->length = -1; | 1545 u->length = 1; |
1546 | 1546 |
1547 } else if (u->headers_in.content_length_n == 0) { | 1547 } else if (u->headers_in.content_length_n == 0) { |
1548 /* empty body: special case as filter won't be called */ | 1548 /* empty body: special case as filter won't be called */ |
1549 | 1549 |
1550 u->pipe->length = 0; | 1550 u->pipe->length = 0; |