Does zero buffer allowed in the output buffer chain?

Maxim Dounin mdounin at
Wed Jan 30 19:12:54 UTC 2013


On Wed, Jan 30, 2013 at 11:03:15AM +0800, Liu Haifeng wrote:

> I am writing a http handler module, I found when the last buffer 
> in the output buffer chain is zero, I'll get an alert in the 
> error log about zero output buffer, and the browser will get no 
> response after waiting a while, this is not what I am expecting 
> as the buffer chain has data, just the last one has zero size. 
> Does this a feature or I missed something else?

Zero size buffers are not expected to appear in the output chain 
except due to some bug, and if they do appear - it's considered to 
be a fatal error and results in a connection close.

Normally you should not add empty buffers to the output chain.  If 
there are some good reasons why you need to add an empty buffer - 
you have to mark the buffer as special, e.g., by setting the 
b->sync flag as Jeff Kaufman already suggested.

Maxim Dounin

More information about the nginx mailing list