Maxim Dounin
October 21, 2019 08:42AM
Hello!

On Thu, Oct 17, 2019 at 04:42:54PM -0400, Ansuel wrote:

> I don't know if this is a bug or not but... yes you were right...
>
> All the work should be done in the ngx_http_read_client_request_body
> handler, as it does duplicate the r connection to another address
>
> What confused me is the fact that this is only done in http2 connections...
>
> I really don't know why but all the changes i do in the read_client_request
> handler reflect to the main ngx_http_request_t struct. I thought the code
> was cleaner by having the body read in a function and parse the data from it
> in another function.
>
> Well this doesn't work with http2 because all the changes done in
> read_client_request handler get lost and doesn't apply to the main struct...
>
>
> Think this is a bug as the behavior should be similar and not change across
> http versions...
>
> Sorry for the bad explanation... Also i think this should be noted in the
> wiki.

It looks like you don't understand how things work. First
of all, when the ngx_http_read_client_request_body() function
returns, it doesn't mean that the request body was successfully
read, and the body handler function was already called.

You may want to start with reading more about event-driven
programming in general. Also, as previously suggested, you may
want to read Development guide, it has enough information about
how things work and how they are expected to be handled.

Also, if you want to better understand how nginx works, consider
reading nginx source code - it is the only direct source of the
information.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
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: 277
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