15 messages in ru.sysoev.nginxRe: sending data in "chunks"
FromSent OnAttachments
Manlio PerilloSep 16, 2007 10:36 am 
Igor SysoevSep 16, 2007 10:43 am 
Manlio PerilloSep 16, 2007 11:07 am 
Igor SysoevSep 16, 2007 11:13 am 
Manlio PerilloSep 16, 2007 11:35 am 
Igor SysoevSep 16, 2007 11:43 am 
Adrian Perez de CastroSep 16, 2007 1:35 pm 
Manlio PerilloSep 16, 2007 1:50 pm 
Igor SysoevSep 18, 2007 11:29 am 
Igor SysoevSep 18, 2007 11:32 am 
Manlio PerilloSep 18, 2007 12:16 pm 
Igor SysoevSep 18, 2007 12:30 pm 
Manlio PerilloSep 18, 2007 12:44 pm 
Adrian Perez de CastroSep 19, 2007 7:59 am 
Manlio PerilloSep 21, 2007 1:02 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: sending data in "chunks"Actions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Sep 21, 2007 1:02:16 pm
List:ru.sysoev.nginx

Igor Sysoev ha scritto:

[...]

So, please let me know if I'm right:

- when a call to ngx_http_output_filter with a buffer chain of *only one* buffer returns with NGX_OK, it means that the *entire* buffer has been sent to the client.

Yes. Or if gzipping is enabled the entire buffer is buffered inside zlib.

If nginx return NGX_AGAIN then I have to set the request->write_event_handler so that my handler is executed when the socket is ready to send data again.

Yes.

I have done some tests with mod_wsgi.

If a WSGI application returns a big buffer, ngx_http_output_filter returns NGX_AGAIN, *however* the entire buffer is sent to the client.

This is the same behaviour with a "full" buffer chain, with the difference that even if I return NGX_AGAIN from my request handler, the client reads the full response (with a "full" buffer chain in a previous test, I have to return NGX_OK, when receiving NGX_AGAIN).

So, it seems that nginx will send the entire content of a buffer, as soon as control returns to it.

This is important for me: when ngx_http_output_filter returns NGX_AGAIN, should I have to send again the previous buffer when my handler is called from the write event, or I can safely send the next buffer?