releasing memory.

2017-05-17 Thread Dk Jack
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
). 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

Re: How to make nginx mail auth connection persistent?

2017-05-17 Thread Maxim Dounin
Hello!

On Wed, May 17, 2017 at 05:32:55AM +, Prabhash Rathore wrote:

> Hi Maxim,
> 
> As per your suggestion to use Proxy server for auth_http directive in mail
> to enable keepalive connection, I recompiled my nginx with http and added
> following http configuration.
> 
> http {
> server {
> server_name foo_server;
> location / {
> proxy_http_version 1.1;
> proxy_pass http://hostname:port/auth.php;
> }
> }
> }
> 
> Now in mail directive, I am trying to refer this server from auth_http as
> follows but nginx does not recognize foo_server while start up. Could you
> please let me know how I can point "auth_http" to a proxy server configured
> in nginx config?
> 
> mail {
>auth_http foo_server;# my server name from http config
> }
> 
> Please let me know if this is not possible with just config chages then we
> will try to look at code change options.

You may want to ask for help in the nginx@ mailing list.  This 
mailing list if for developers and certainly not appropriate for 
this kind of questions.

You may also want to read nginx documentation as available here: 

http://nginx.org/en/docs/

Thank you.

-- 
Maxim Dounin
http://nginx.org/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel