Thanks for the answer, but its difficult to understand how can that happen. I even compare output of modified (by my module) response and unmodified - they are the same, with the only difference that data in chains is filled in another way. I.e. input data lengths are 100-200-100 bytes (.last - .pos) and after my content rewriting module they can be 0-0-400, or even 0-0-0 chain, and data can be added in next chain. I am doing buffering to match some patterns. In fact of this I see in error log:
[alert] 31974#0: *98657 zero size buf in writer t:1 r:1 f:0 0000000001714FE0 0000000001F8D290-0000000001F8D290 0000000000000000 0-0 while sending to client
Is that ok, to have zero size bufs, or I need to modify the chain, not to pass them forward to other modules?