Opened 4 years ago

Closed 4 years ago

#1132 closed defect (worksforme)

preread post request body not returned for h2

Reported by: malini.kothapalli@… Owned by:
Priority: major Milestone:
Component: other Version: 1.9.x
Keywords: Cc:
uname -a: Linux 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx: nginx version: instart/nginx based on: 1.9.12
built by gcc 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04)
built with OpenSSL 1.0.2h-fips 3 May 2016
TLS SNI support enabled

Description

I am experimenting with POST over h2. The use case is to read full request body in rewrite phase and process it for further undisclosed use. What I am seeing is if client request body is already read along with http headers by the time ngx_http_read_client_request_body function is called, the preread body is never returned to the post handler. This is unlike how http/1.1 works (relevant code in ngx_http_read_client_request_body function), that is, http/1.1 specific code returns the preread client request body to post handler.

Change History (2)

comment:1 by Valentin V. Bartenev, 4 years ago

The request body in HTTP/2 comes in separate frames. If all such frames has been already parsed by the time, when ngx_http_read_client_request_body() is called, then the preread body is returned to the post handler. That can happen when request processing is delayed (e.g. due to the limit req or the auth request modules) and the request body is small enough.

Could you elaborate how do you test this and why do you think that there is some bug?

comment:2 by Maxim Dounin, 4 years ago

Resolution: worksforme
Status: newclosed

Feedback timeout.

Note: See TracTickets for help on using tickets.