[PATCH] Make ngx_http_upstream provide a way to expose errors after sending out the response header

Maxim Dounin mdounin at mdounin.ru
Mon Apr 8 00:23:18 UTC 2013


On Sun, Apr 07, 2013 at 04:25:11PM -0700, agentzh wrote:

> Here attaches the upstream_truncation V4 patch. Changes since V3 are
> * set u->length to -1 in u->input_filter_init in ngx_uwsgi and
> ngx_scgi because they do not set u->pipe->length (like ngx_proxy) but
> set u->length (via ngx_http_upstream) which causes false positive for
> response data truncation.

This looks wrong.

The u->length should be used/checked in case of non-buffered processing 
only, u->pipe->length - in case of buffered.  The patch seems to 
check both, and this is probably what causes your problems. 

Maxim Dounin

More information about the nginx-devel mailing list