Welcome! Log In Create A New Profile

Advanced

Got "http reading blocked" on second request with same connection

November 09, 2021 06:40PM
Hi I'm having problem with my custom nginx module.
I created nginx module to detect wether the request is authorized or not,
and I need to check request body. So I use ngx_http_read_client_request_body in NGX_HTTP_ACCESS_PHASE.
Modules work perfectly on one request at a time. For example: 'curl -v localhost'
But the problem happen when second request happen using same connection. For example: 'curl -v localhost localhost'.

When I try to debug I got "http reading blocked". But when I remove ngx_http_read_client_request_body, and leave body empty, it's work

static ngx_int_t
ngx_http_ai_inspect_handler(ngx_http_request_t *r)
{
ngx_chain_t *in;
ngx_http_read_client_request_body(r, ngx_http_ai_inspect_post_handler);
off_t len = 0;
if (r->request_body != NULL) {
for (in = r->request_body->bufs; in; in = in->next) {
len += ngx_buf_size(in->buf);
}
}

}
Subject Author Posted

Got "http reading blocked" on second request with same connection

frdcybermatrix November 09, 2021 06:40PM

Re: Got "http reading blocked" on second request with same connection

Maxim Dounin November 10, 2021 02:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 51
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready