How to insert something in the middle of the buf?

witekfl witekfl at gazeta.pl
Wed Oct 17 10:24:31 UTC 2012


Hi,
there is the code:
http://rkd.republika.pl/ngx_http_layout_filter_module.c

I want to insert the header before </head> and the footer before </body>.
If there is no </head> add the header as the first chunk.
If there is no </body> add the footer as the last chunk.

The problem is that, the number of waiting growing rapidly.
What is wrong with this code?
Could you provide a snippet how to insert something in the middle of  
existing chunk
or how to do that right in this situation (reading from file)?
And why the number of waiting connections is growing so fast?



More information about the nginx-devel mailing list