Welcome! Log In Create A New Profile

Advanced

releasing memory.

May 17, 2017 08:54PM
Hi,
In my module, I registered a NGX_HTTP_POST_READ_PHASE handler. When this
handler is invoked, I allocate my module context and attach it to the
request. I also allocate some other memory and save the pointers to that
memory in my context. In the POST_READ_PHASE handler, I also register a
cleanup handler to the request (r->cleanup; ngx_http_cleanup_t
http://lxr.nginx.org/ident?_i=ngx_http_cleanup_t). I assumed this is
called before the request is freed.

As I expected, my cleanup handler is getting called for most of the
requests. However, in some cases it doesn't get called. This seems to
happen mostly for the first request and if and only if the request is a
very simple url like 'http://servername/' i.e. a simple request which tests
server is up and running or not. If I add anything more to the uri-path,
the cleanup handler gets called. Otherwise, it doesn't get called. Seems
very strange. Could someone more knowledgeable comment on this behavior.
Thanks.

Dk.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

releasing memory.

dnj0496 867 May 17, 2017 08:54PM

Re: releasing memory.

Maxim Dounin 409 May 18, 2017 09:34AM

Re: releasing memory.

dnj0496 577 May 18, 2017 01:24PM

Re: releasing memory.

Maxim Dounin 458 May 18, 2017 01:58PM

Re: releasing memory.

dnj0496 612 May 18, 2017 06:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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