]> git.kaiwu.me - nginx.git/commit
Upstream: drop extra data sent by upstream.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:22 +0000 (18:36 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:22 +0000 (18:36 +0300)
commitdfcfcc5a881bf4b349f74c9a0a04da2d861f02bf
tree123f0f5782735503d5a27c79c1ad875c47d8b005
parent7f2490c43cec0367c94e9e0a3881f4e5e32063de
Upstream: drop extra data sent by upstream.

Previous behaviour was to pass everything to the client, but this
seems to be suboptimal and causes issues (ticket #1695).  Fix is to
drop extra data instead, as it naturally happens in most clients.

This change covers generic buffered and unbuffered filters as used
in the scgi and uwsgi modules.  Appropriate input filter init
handlers are provided by the scgi and uwsgi modules to set corresponding
lengths.

Note that for responses to HEAD requests there is an exception:
we do allow any response length.  This is because responses to HEAD
requests might be actual full responses, and it is up to nginx
to remove the response body.  If caching is enabled, only full
responses matching the Content-Length header will be cached
(see b779728b180c).
src/event/ngx_event_pipe.c
src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream.h