Welcome! Log In Create A New Profile

Advanced

Re: Writing a timer event (how to execute an event from time to time)

Maxim Dounin
May 25, 2010 09:14AM
Hello!

On Tue, May 25, 2010 at 08:35:15AM -0300, Rogério Schneider wrote:

> > Each request may clean its pool when finalizing the request. And the timer
> > uses the pool attached with that request. This caused the segfaults.
>
> In fact the segfault occurs before the request/response end. Since I
> am responding with http chunked, and buf->last_buf = 0, the client
> stills connected and "downloading the stream" for an infinite time.

Not setting last_buf doesn't mean that request will not be
finalized and freed. As soon as you return from content handler -
ngx_http_finalize_request() will be called, and it will free
request as long as r->main->count == 1.

If you want request to persist for other actions - you have to
increment r->main->count (and decrement it via calling
ngx_http_finalize_request() once you're done) and return NGX_DONE
from content handler.

See memcached (+ upstream) module, and perl module for examples in
nginx code. Set ngx_http_request.c and ngx_http_core_module.c for
details about request processing.

Maxim Dounin

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

Writing a timer event (how to execute an event from time to time)

Rogério Schneider 4069 May 25, 2010 01:18AM

Re: Writing a timer event (how to execute an event from time to time)

Weibin Yao 1275 May 25, 2010 01:34AM

Re: Writing a timer event (how to execute an event from time to time)

Rogério Schneider 1225 May 25, 2010 07:36AM

Re: Writing a timer event (how to execute an event from time to time)

Maxim Dounin 1212 May 25, 2010 09:14AM

Re: Writing a timer event (how to execute an event from time to time)

Rogério Schneider 1076 May 25, 2010 10:06AM

Re: Writing a timer event (how to execute an event from time to time)

Maxim Dounin 1594 May 25, 2010 11:12AM

Re: Writing a timer event (how to execute an event from time to time)

Piotr Sikora 1048 May 25, 2010 05:14AM

Re: Writing a timer event (how to execute an event from time to time)

Rogério Schneider 1096 May 25, 2010 07:42AM

Re: Writing a timer event (how to execute an event from time to time)

Peter Leonov 1168 May 25, 2010 07:08AM

Re: Writing a timer event (how to execute an event from time to time)

Rogério Schneider 1095 May 25, 2010 07:48AM

Re: Writing a timer event (how to execute an event from time to time)

Peter Leonov 1015 May 25, 2010 08:56AM

Re: Writing a timer event (how to execute an event from time to time)

Rogério Schneider 1102 May 25, 2010 10:08AM



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

Online Users

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