Am Mi, 30.03.2011, 12:17 schrieb Chris Datfung: > I have a script that uses Apache2::Filter to filter the server response > output and inject a string into the HTML body. The script normally works > fine expect intermittently the output is missing the injected string. This > happens around 10% of the time. I verified that there is enough memory and > CPU available and tried playing with the buffer size, but to no avail. > > The server is running: > > Apache 2.2.17-2 > Modperl 2.0.4-7 > > Any explanation for why the script fails 10% of the time? > > Thanks > Chris >
I had a similar problem with a http proxy that injected a string into the HTML body. If the response is passed to the filter in multiple parts there is a certain probability that the response is split on the string position you are looking for (for example part 2 ends with "</bo" and part 3 starts with "dy>"). I had to buffer the last bytes of each response part and take them into account when looking for the search-string in the next part. I dont know though if this is possible in Apache2::Filter or if this is your problem at all. Hendrik
