Output body buffer chain "flattening" doesn't work unless proxy buffering is off

Maxim Dounin mdounin at mdounin.ru
Tue Jun 8 02:30:41 MSD 2010


Hello!

On Mon, Jun 07, 2010 at 10:41:57PM +0200, Srebrenko Šehić wrote:

> On Mon, Jun 7, 2010 at 9:08 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> 
> Hi,
> 
> >> Makes sense. How does one mark them as sent? I didn't see any flags in
> >> ngx_buf_t that makes that obvious. I did try to play with b->last_buf
> >> (but that should be set to 1 only for the very last buffer in the
> >> response) and also b->last_in_chain, but that did not make any
> >> difference.
> >
> > b->pos = b->last;
> 
> I guess that should be done after the call to
> ngx_http_next_body_filter(r, in).

It should be done on each buffer in input chain as soon as it's no 
longer needed.

> I tried that, but it did not make
> any difference. It still "hangs" for payloads larger than 32KB.
> 
> Any hints?

Probably you did something wrong.

Note well: there are other problems in code you posted as well 
(e.g. you don't pass special buffers along filter chain).  If you 
actually try to make this code work as is - expect other problems 
as well.

Note well 2: it's good idea to spend some time digging into nginx 
source code.

Maxim Dounin



More information about the nginx-devel mailing list