ngx_http_read_client_request_body() causing random timeouts

agentzh agentzh at
Tue May 31 12:28:39 MSD 2011

On Tue, May 31, 2011 at 4:08 PM, Srebrenko Šehić <ssehic at> wrote:
>    if (r->method != NGX_HTTP_POST) {
>        return NGX_DECLINED;
>    }
>    ctx = ngx_palloc(r->pool, sizeof(ngx_http_dummy_post_read_ctx_t));

I think you should have used ngx_pcalloc here instead of ngx_palloc so
as to initialize the bytes properly ;) We're using ngx_pcalloc
correctly here in ngx_form_input.

You're recommended to use tools like valgrind memcheck (or gcc's
builtin malloc check) to spot issues like this :)


More information about the nginx-devel mailing list