Welcome! Log In Create A New Profile

Advanced

Re: Reading large request body using ngx_http_read_client_request_body

Maxim Dounin
May 21, 2019 08:52AM
Hello!

On Mon, May 20, 2019 at 04:35:51PM -0400, NginxNewbee wrote:

> Thanks. Your understanding is correct. For cases, when
> ngx_http_read_client_request_body returns NGX_AGAIN, thread returns and
> request will get finalized. I'll go ahead and move reading contents of r and
> request body to main thread in the content handler and just keep execution
> of our business logic on thread.
>
> Just one more question - Once I move ngx_http_read_client_request_body in
> content handler on main thread and it returns NGX_AGAIN, how should I handle
> it? Code sample on nginx developer reference, recommends this.
>
> ngx_int_t
> ngx_http_foo_content_handler(ngx_http_request_t *r)
> {
> ngx_int_t rc;
>
> rc = ngx_http_read_client_request_body(r, ngx_http_foo_init);
>
> if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
> /* error */
> return rc;
> }
>
> return NGX_DONE;
> }

As long as ngx_http_read_client_request_body() is used in a
content handler and returns NGX_AGAIN, no special handling is
needed. Just returning NGX_DONE as in the example is enough.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 18, 2019 05:10PM

Re: Reading large request body using ngx_http_read_client_request_body

Maxim Dounin May 20, 2019 10:00AM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 20, 2019 03:04PM

Re: Reading large request body using ngx_http_read_client_request_body

Maxim Dounin May 20, 2019 03:42PM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 20, 2019 04:35PM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 21, 2019 12:28AM

Re: Reading large request body using ngx_http_read_client_request_body

Patrick May 21, 2019 12:48AM

Re: Reading large request body using ngx_http_read_client_request_body

Maxim Dounin May 21, 2019 08:52AM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 21, 2019 12:53PM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 24, 2019 05:15PM

Re: Reading large request body using ngx_http_read_client_request_body

Maxim Dounin May 27, 2019 09:30AM

Re: Reading large request body using ngx_http_read_client_request_body

NginxNewbee May 28, 2019 06:19PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 282
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