bug of discarding request body

Shuxin Yang shuxinyang.oss at gmail.com
Mon Nov 23 17:26:46 UTC 2015

Hi, Maxim:

     Thank you very much for the comment, and sorry for my long previous 

     I guess you might misunderstand my previous email. Basically what I 
try to say
is that the *OLD* bug (ticket/669 as you mentioned) is seen on the 
1.9.7 release. The attached script can reproduce the problem by simply 

    The a.sh donwload the 1.9.7 release, build it *without* any 3rd 
party module.

    The problem is triggered by turning off unbuffered-uploading in 
proxy server.
IIRC, when people report ticket/669, unbuffered-uploading was not 

    I guess we ngx_http_discard_request_body() should return NGX_AGAIN
instead NGX_OK if discarding body is in progress.

    Also see the following interleaving response.

Best Regards

On 11/22/2015 05:24 PM, Maxim Dounin wrote:
> There is no problem in returning a response before reading the
> whole body.


> It looks like you've run into the old bug in the proxy module,
> which doesn't handle such responses in keepalive connections
> properly, see additional details here:
> https://trac.nginx.org/nginx/ticket/669
> Correct fix would be to stop nginx from re-using upstream
> connections where a request wasn't completely sent.
We cannot tell if it is complete or not if 
ngx_http_discard_request_body() always
returns NGX_OK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repro_400.tar.gz
Type: application/gzip
Size: 1152 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20151123/692da9d7/attachment.bin>

More information about the nginx mailing list