Welcome! Log In Create A New Profile

Advanced

Re: handle NGX_AGAIN properly

Yichun Zhang (agentzh)
July 14, 2013 02:42AM
Hello!

On Sat, Jul 13, 2013 at 4:43 PM, Julien Zefi wrote:
>
> I have been trying many workarounds without luck, the last one that i have
> is that if in my timer-callback the flush returns NGX_AGAIN, invoke a new
> handler that sends out an empty chain, but it continue returning NGX_AGAIN,
> it never backs to NGX_OK, this is how it looks:
>

It seems that what you're doing is very wrong. You'd better take a
look at how the ngx_http_writer and ngx_http_set_write_handler
functions are implemented in the Nginx core instead of shooting in the
darkness. Basically:

1. Flush outputs by r->write_event_handler instead of in your timer
handler because you should only retry sending the outputs upon a
epoll/poll/select write event.

2. By "sending out an empty chain", I actually mean

rc = ngx_http_output_filter(r, NULL);

You can see this line in the ngx_http_writer function. You're just
sending out a last_buf chain.

Regards,
-agentzh

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

handle NGX_AGAIN properly

Julien Zefi 1170 July 09, 2013 08:14PM

Re: handle NGX_AGAIN properly

Yichun Zhang (agentzh) 615 July 09, 2013 09:04PM

Re: handle NGX_AGAIN properly

Julien Zefi 660 July 13, 2013 08:22PM

Re: handle NGX_AGAIN properly

Yichun Zhang (agentzh) 564 July 14, 2013 02:42AM

Re: handle NGX_AGAIN properly Attachments

Julien Zefi 591 July 14, 2013 11:44PM

Re: handle NGX_AGAIN properly

wandenberg 639 January 03, 2015 07:00PM



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

Online Users

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