[Rabbit-dev] FilterHandler is unable to correctly parse some buffer streams

Mindaugas Žakšauskas mindas at gmail.com
Sat Dec 12 22:49:51 CET 2009


2009/12/12 Robert Olofsson <robert.olofsson at khelekore.org>

> If you add the HttpSnoop filter to the httpoutfilters you can easily see
> <..> the data is gzipped.
>

Cool, thanks for explanation! That just suddenly started to make sense now.


> Rabbit should not normally try to filter this data, if it is then it is
> doing the
> wrong thing.
>

Yep, I think the fix is necessary (at least in 4.2, haven't got a chance to
look at 4.3). Something like

if ("gzip".equals(response.getHeaders("Content-Encoding"))) {
   return;
}

in FilterHandler::handleArray, just before parser.setText (arr, off, len)
perhaps?
But this might be just too straightforward...

If you set "repack=true" rabbit ought to unpack and filter pages
> that are gzipped.
>

This makes sense only if repack=true *and* compress=true. If compress=false
and repack=true, browser ends up in "Content Encoding Error" when trying to
get gzipped stream, such as http://www.guardian.co.uk. Is this expected?

Rabbit does not normally try to unzip compressed pages, since
> compressed content means that someone has already thought about
> minimizing the content and then rabbit will only add latency.
>

Yes, unless one wants to be too intrusive or more user friendly :)

Also, another question: what is the best way to share data
between proxy.filter.HttpFilter and proxy.filter.HtmlFilter?
E.g. say I want to show a nice (HTML) error screen (which I would normally
do in proxy.filter.HtmlFilter) if user is not authenticated (and that's
decided in proxy.filter.HttpFilter), instead of just throwing a default HTTP
407.
One way of doing this would be throwing extra rabbit.http.HttpHeader and
check (also delete?) it later. But is this good enough? Any other options?

Thanks a lot for help!

Regards,
Mindaugas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khelekore.org/pipermail/rabbit-dev/attachments/20091212/b9d526f4/attachment-0001.html>


More information about the Rabbit-dev mailing list