Hi,<div><br></div><div>I was playing with various Html filters (e.g. BackgroundFilter) but strangely I am getting intermittent results.</div><div><br></div><div>Basically I only want to add some extra stuff to the output HTML and do not bother with gzipping at all (any reason why FilterHandler extends GZipHandler?). So my config is like this:</div>

<div><br></div><div>8<------------------------------------------------------------------------------------</div><div># </div><div>text/html=rabbit.handler.FilterHandler</div><div><div>text/html;charset\=iso-?8859-1=rabbit.handler.FilterHandler</div>
<div>text/html;charset\=iso-?8859_1=rabbit.handler.FilterHandler</div>
<div>text/html;charset\=utf-?8=rabbit.handler.FilterHandler</div><div>text/html;charset\=utf_?8=rabbit.handler.FilterHandler</div><div><br></div></div><div># few lines below....</div><div><br></div><div><div>[rabbit.handler.GZipHandler]</div>

<div># If I set this to false, no filtering happens - at all! WTF?</div><div>compress=true</div><div><br></div></div><div>[rabbit.handler.FilterHandler]</div><div>
<div>filters=rabbit.filter.BodyFilter,rabbit.filter.BackgroundFilter</div><div>8<------------------------------------------------------------------------------------</div><div><br></div><div>Now if I place a breakpoint in rabbit.filter.BackgroundFilter::handleTag (the line which does tag.removeAttribute ("background");) it sometimes stops (and works correctly) but sometimes doesn't. E.g. it stops if I go to</div>
<div><br></div><div><a href="http://www.ukstudentlife.com/Life/Money.htm">http://www.ukstudentlife.com/Life/Money.htm</a> (1)</div><div>but doesnt if I go to</div><div><a href="http://en.wikipedia.org/wiki/South_African_Republic_pond">http://en.wikipedia.org/wiki/South_African_Republic_pond</a> (2)</div>
<div><br></div><div>The reason why this is so intermittent is because the byte buffer array (named "arr") which is formed in FilterHandler::modifyBuffer sometimes comes as meaningful text and sometimes as unparseable garbage. If I try to create a new String from this array - readable string is created for page (1) but is total garbage for (2). At some later stage, when parser parses this garbage, it spits a single HtmlBlock which is yet another invariant of same garbage anyway.</div>
<div><br></div><div>The reason why "arr" array sometimes comes as garbled must be coming from implementation details of rabbit.io.BufferHandle (rabbit.io.CacheBufferHandle in my case). It is rather hard and time consuming for me to dig deeper to understand what might be wrong here, but I hope I have provided enough pointers for somebody who knows the internals better.</div>
<div><br></div><div>Somebody else seen this problem before? Does this depend on different HTTP server behaviour (to me it looks so)?</div><div>BTW, I am using Rabbit 4.2.</div><div><br></div><div>m.</div><div><br></div></div>