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:Igor Sysoev (is-G@public.gmane.org)
Date:Sep 18, 2007 11:29:06 am
List:ru.sysoev.nginx

On Sun, Sep 16, 2007 at 10:35:42PM +0200, Adrian Perez de Castro wrote:

El Sun, 16 Sep 2007 22:14:14 +0400 Igor Sysoev <is-G@public.gmane.org> escribi??:

On Sun, Sep 16, 2007 at 08:08:09PM +0200, Manlio Perillo wrote:

Igor Sysoev ha scritto:

On Sun, Sep 16, 2007 at 07:36:49PM +0200, Manlio Perillo wrote:

I need to send to the client some data in chunks. [...]

Ok, thanks.

[...]

I have also found the real problem: one of the call to ngx_http_output_filter fails with a return value -2.

Now I have to found the problem...

It's NGX_AGAIN. If you have got all your data ready you may send them at once in one chain. But if you are getting then gradually, then after NGX_AGAIN you should set event handlers and timer and return control to nginx.

Mmmh, this affects me as well in the fancyindex module. When doing subrequests for header inclusion the call to ngx_http_output_filter returns NGX_AGAIN. I have just assumed NGX_AGAIN does not need extra work, and the rest of the data I send goes to the client...

So I suppose I am making the worker process block too much, isn't it?

I can only send all data in one chain when not using header/footer (they are subrequests), so I think it will be better to fix my code :D

In your case, when you subrequest local files you can treat NGX_AGIAN as NGX_OK. If you subrequest remote sites, then you need some handling of this subrequests.