Could someone please review this code snippet and tell me what I've missed?
Wandenberg Peixoto
wandenberg at gmail.com
Mon Dec 26 01:33:41 UTC 2011
You probably should use ngx_http_get_module_ctx/ngx_http_set_module_ctx to
keep your timer reference,
if you want to have one timer per request.
ngx_http_get_module_loc_conf will do one timer per location.
On Sun, Dec 25, 2011 at 10:20 PM, Alexandr Gomoliako <zzz at zzz.org.ua> wrote:
> On Mon, Dec 26, 2011 at 1:08 AM, J.Q. S. <q2011oct at gmail.com> wrote:
> > As an exercise I've written a module which receives a request, sets a 10
> > second timer, then replies "Hello World!" when the timer expires. I'm
> > running nginx with deamon off/master off to make things as simple as
> > possible. The first time through everything seems to work perfectly.
> > However, the second time I don't get any response at all - from any url
> the
> > server normally handles. This code does work though multiple invocations
> if
> > I call bottom handler function directly from the top handler function,
> > without using the timer. I was wondering if someone could spot check my
> code
> > and tell me what I'm doing wrong?
>
> > static ngx_int_t ngx_http_alpha_handler_bottom(ngx_event_t *ev) {
> ...
>
> > return(ngx_http_output_filter(r, &out));
>
> You have to finalize your request manually here.
>
> P.S.
> I have a simple call tracer for nginx, should help you figure out
> how everything works in no time, literally.
>
> Check it out:
> https://github.com/zzzcpan/ngx_trace
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20111225/3ff9c683/attachment-0001.html>
More information about the nginx-devel
mailing list