comparison src/http/ngx_http_upstream.h @ 7678:bffcc5af1d72

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).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 06 Jul 2020 18:36:22 +0300
parents e573d74299a0
children 05e42236e95b
comparison
equal deleted inserted replaced
7677:a786e491d08d 7678:bffcc5af1d72
412 } ngx_http_upstream_param_t; 412 } ngx_http_upstream_param_t;
413 413
414 414
415 ngx_int_t ngx_http_upstream_create(ngx_http_request_t *r); 415 ngx_int_t ngx_http_upstream_create(ngx_http_request_t *r);
416 void ngx_http_upstream_init(ngx_http_request_t *r); 416 void ngx_http_upstream_init(ngx_http_request_t *r);
417 ngx_int_t ngx_http_upstream_non_buffered_filter_init(void *data);
418 ngx_int_t ngx_http_upstream_non_buffered_filter(void *data, ssize_t bytes);
417 ngx_http_upstream_srv_conf_t *ngx_http_upstream_add(ngx_conf_t *cf, 419 ngx_http_upstream_srv_conf_t *ngx_http_upstream_add(ngx_conf_t *cf,
418 ngx_url_t *u, ngx_uint_t flags); 420 ngx_url_t *u, ngx_uint_t flags);
419 char *ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, 421 char *ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
420 void *conf); 422 void *conf);
421 char *ngx_http_upstream_param_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, 423 char *ngx_http_upstream_param_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,