Welcome! Log In Create A New Profile

Advanced

read request body with http2

October 13, 2019 08:47PM
Hello, i'm developing a custom module that needs to read the request body to get some data from it.
To read the request body i'm using

ngx_http_read_client_request_body

and in the callback i use

for (in = r->request_body->bufs; in; in = in->next) {
len = ngx_buf_size(in->buf);
ngx_memcpy(buffer + pos,in->buf->pos,len);
pos += len;
}

To put the data in a char buffer

Aside from the fact that put request body in a buffer is wrong because it can became very big...

I notice that if i enable http2 connection, the request body doesn't get read at all.... I notice the function read_client_request_body is never called...
Am i missing something or there are some specail way to wait/read the request body with http2? By disabling it (remove support from nginx.conf) the module works as it should and i can correctly read the request body.

I really hope this can be solved as i don't want to remove http2 support for this...
Subject Author Posted

read request body with http2

Ansuel October 13, 2019 08:47PM

Re: read request body with http2

Maxim Dounin October 14, 2019 10:26AM

Re: read request body with http2

Ansuel October 14, 2019 02:41PM

Re: read request body with http2

Maxim Dounin October 15, 2019 10:58AM

Re: read request body with http2

Ansuel October 17, 2019 04:42PM

Re: read request body with http2

Maxim Dounin October 21, 2019 08:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready