Welcome! Log In Create A New Profile

Advanced

ngx_http_cleanup_add

November 10, 2021 10:24PM
Hi,
In my module, I am allocating some memory for each request and saving the
ptr in my module context. I am registering a callback using
ngx_http_cleanup_add to perform cleanup for each request. I am releasing
the memory for the allocation in the cleanup callback. In the log phase, I
want to make available the contents of the memory I allocated as an nginx
variable.

However, when I try to print this variable in the log, the memory has
already been de-allocated. It looks like the clean-up handlers are called
before the log phase. Since I have released the memory in the cleanup
handler, I have nothing to log in the log phase. Is there a way to defer
the calling of the clean-up handler until after the log phase?

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

ngx_http_cleanup_add

dnj0496 303 November 10, 2021 10:24PM

Re: ngx_http_cleanup_add

Maxim Dounin 129 November 10, 2021 10:48PM

Re: ngx_http_cleanup_add

dnj0496 135 November 10, 2021 11:04PM



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

Online Users

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