Tracker: Patches

5 gzip and zlib decompression - ID: 895531
Last Update: Comment added ( fabiankeil )

Here is a patch I wrote more than a year ago that
allows Privoxy to decompress and filter
gzip-compressed data. Sorry about not submitting it
earlier, but I dusted it off tonight and thought I'd
post it now.

To summarize, when we need to filter data sent by a
server and it is compressed, this patch allows Privoxy
to decompress it, filter, and send the result to the
client decompressed. Possible future improvements
include re-compressing after filtering but before
sending to the client (would this be useful?), and
allowing Privoxy to accept compressed data even if the
client doesn't.

I've tested the patch with servers that send
"Content-Encoding: gzip" (e.g. Slashdot), and it seems
to be stable. Previously I also tested with zlib
compression, but I'm not sure that zlib is ever used in
practice anyway.

To use:
apply the patch
run configure with the --enable-zlib option
start privoxy and test

Note that this patch currently disables Privoxy's
default of removing Accept-Encoding headers that allow
compression. It doesn't yet include any documentation,
but I can add some if this is received well.

The patch is against latest CVS, but should apply
without major changes to any recent version.

Comments are appreciated.


Wil Mahan ( wmahan ) - 2004-02-12 08:26

5

Closed

Accepted

Fabian Keil

new feature

None

Public


Comments ( 12 )




Date: 2007-07-28 09:03
Sender: fabiankeilProject Admin


What kind of news are you looking for?

As you can read in the comments a modified
version of the patch is in CVS since about
half a year.


Date: 2007-07-27 22:41
Sender: rdhatch


Any news on this patch? I would much rather use Privoxy with gzip
support, than prevent-compression.


Date: 2007-01-16 03:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2007-01-03 11:52
Sender: fabiankeilProject Admin


Apparently it works with mingw32 if one makes
sure that zlib.h and zconf.h are found by
gcc and that Privoxy can find cygz.dll and
cygwin.dll.


Date: 2007-01-01 20:03
Sender: fabiankeilProject Admin


I just integrated a modified version of Wil's patch,
feedback welcome.

To test it, recompile with the --enable-zlib
configure switch and disable prevent-compression.

At the moment there is no way to enable/disable
it without recompiling, but it's supposed to work
with all sites anyway.

Note that it currently doesn't compile with
all zlib version out there. I tested it on
FreeBSD and confirmed that it compiles on
cygwin, but it fails with mingw32.

I had to make some changes that affect Privoxy
even if --enable-zlib isn't used, so regression
testing would be useful even if you're using
an unsupported zlib version.


Date: 2006-08-18 13:07
Sender: david__schmidtProject Admin

Logged In: YES
user_id=249980

I'm attaching Roland's version of the patch since it appears
to be in his /tmp directory. ;-)


Date: 2006-08-05 18:22
Sender: roro

Logged In: YES
user_id=43129

Okay, the new version of the patch does no longer segfault on every click,
but now google does not fully work for me (using privoxy with a forward to
a netcache proxy, if this is relevant). Sometimes I can receive the goole
start page, but the next click gives me "Error: Invalid gzip header when
decompressing" in the log and no output in the browser.

So I will stop using it until someone more familiar than me fixes this
bug.


Date: 2006-08-05 16:46
Sender: roro

Logged In: YES
user_id=43129

I tried to adapt this patch from 3.1 code to 3.0.3.
You'll find the adapted patch at:
http://www.spinnaker.de/tmp/privoxy-3.0.3-gzip.patch
I didn't do much testing, but up to now it seems to work okay.



Date: 2004-02-13 03:24
Sender: hal9Project Admin

Logged In: YES
user_id=322640

William, just so you and other new comers know, part of the
discussion will probably be how to deal with current source
tree. A group decision was made when 3.0.0 was released that
only bugfixes and minor feature enhancements would go in
that branch so it would stay stable. Any new features would
go in the main trunk aka the devel branch. But, as time has
dragged on, little work has been done to keep the two in
sync wrt to bugfixes, doc updates, etc. so that main trunk
is probably in need of some help. And it doesn't look to
change radically any time soon. That leaves us the quandry
of living by our own rules and depriving the masses of some
good stuff. Or ... Existing personnel has not had much time,
and there hasn't been much outside help coming in.


Date: 2004-02-13 02:50
Sender: wmahan

Logged In: YES
user_id=613983

Thanks for the quick response. I'm not very familiar with the state of
unstable, but if there's anything else I can do to improve the patch for
whichever branch you think is appropriate, just let me know.

Within the next few days I plan to post an update that removes the tabs
from the patch (oops), adds some documentation to the user manual, and adds
entries in the actionsfile templates.

-- Wil


Date: 2004-02-12 16:04
Sender: hal9Project Admin

Logged In: YES
user_id=322640

Andreas, this is a particularly strong candidate for
inclusion IMO, especially considering how far off the
unstable/testing branch is for everyday use. .02


Date: 2004-02-12 10:32
Sender: oesAccepting Donations

Logged In: YES
user_id=78811

William, thanks a lot for sharing your work!

I've just finished skimming over the patch
and it looks very well done & thoughtfully
integrated into our framework. Nice job!

Apart from minor cosmetics, inclusion into
the actionsfile editor templates, docs and
wider testing it looks ready for shipping,

I'll post to the devel list shortly about the
more general question of how we should
deal with the whole array of waiting and
very worthwile patches that are rotting on
the patch tracker when our stable branch
shouldn't be receiving new code except
bugfixes, and the trunk is in a state that
basically prohibits adding new features.



Log in to comment.




Attached Files ( 2 )

Filename Description Download
privoxy-3.0.3-roro-gzip.patch Roland's 3.0.3 version of the patch Download
privoxy-wtm.patch gzip and zlib decompression, revision 1 Download

Changes ( 8 )

Field Old Value Date By
status_id Pending 2007-01-16 03:20 sf-robot
close_date 2007-01-01 20:03 2007-01-16 03:20 sf-robot
status_id Open 2007-01-01 20:03 fabiankeil
close_date - 2007-01-01 20:03 fabiankeil
resolution_id None 2007-01-01 14:29 fabiankeil
assigned_to nobody 2007-01-01 14:29 fabiankeil
File Added 189657: privoxy-3.0.3-roro-gzip.patch 2006-08-18 13:07 david__schmidt
File Added 76423: privoxy-wtm.patch 2004-02-12 08:26 wmahan