summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2020-07-06 18:36:22 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2020-07-06 18:36:22 +0300
commitdfcfcc5a881bf4b349f74c9a0a04da2d861f02bf (patch)
tree123f0f5782735503d5a27c79c1ad875c47d8b005 /src/http/ngx_http_upstream.h
parent7f2490c43cec0367c94e9e0a3881f4e5e32063de (diff)
downloadnginx-dfcfcc5a881bf4b349f74c9a0a04da2d861f02bf.tar.gz
nginx-dfcfcc5a881bf4b349f74c9a0a04da2d861f02bf.tar.bz2
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).
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http_upstream.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h
index 6079d7236..2c93a324b 100644
--- a/src/http/ngx_http_upstream.h
+++ b/src/http/ngx_http_upstream.h
@@ -414,6 +414,8 @@ typedef struct {
ngx_int_t ngx_http_upstream_create(ngx_http_request_t *r);
void ngx_http_upstream_init(ngx_http_request_t *r);
+ngx_int_t ngx_http_upstream_non_buffered_filter_init(void *data);
+ngx_int_t ngx_http_upstream_non_buffered_filter(void *data, ssize_t bytes);
ngx_http_upstream_srv_conf_t *ngx_http_upstream_add(ngx_conf_t *cf,
ngx_url_t *u, ngx_uint_t flags);
char *ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,