Re: Apache2::Filter Intermittently Missing Injected String

"Hendrik Schumacher" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.