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

Maxim Dounin mdounin at mdounin.ru
Tue May 25 19:10:12 MSD 2010


On Tue, May 25, 2010 at 11:05:22AM -0300, Rogério Schneider wrote:

> > 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.
> Maxim, is there something like that for Nginx 0.7? Reference counting
> for avoiding a request to be finalized?

No, reference counting was introduced in 0.8.11.  In 0.7.* you 
have to return NGX_DONE from content handler, check c->destroyed 
in various places and register cleanup function which will remove 
timers/events in case of request finalization due to errors.

Though I don't really recommend developing for 0.7.*.

Maxim Dounin

More information about the nginx-devel mailing list