Bug 3174 - Patch for specifying zlib compression level
Summary: Patch for specifying zlib compression level
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.7
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2005-10-17 04:12 UTC by Paul Ripke
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:

rsync compression level patch (6.59 KB, patch)
2005-10-17 04:14 UTC, Paul Ripke
no flags Details
My version of adding optional compression-level selection (6.69 KB, patch)
2005-10-17 13:59 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Ripke 2005-10-17 04:12:42 UTC
Attached is a patch against HEAD to enable an optional compression level when
using --compress. Tested on NetBSD, running against both same version and stock
2.6.3 on the remote end, over ssh.

This uses the "feature" that popt will ignore option arguments it isn't
requested to parse. eg. Older rsyncs will happily run with the option

Note, to support the syntax "--compress 1" (ie, space separated), a patch to
popt is required, available from
Comment 1 Paul Ripke 2005-10-17 04:14:11 UTC
Created attachment 1517 [details]
rsync compression level patch
Comment 2 Wayne Davison 2005-10-17 13:49:13 UTC
The problem with using an optional arg with popt is that a following option
(e.g. "--compress -v") treats the following option as the arg to --compress
(which seems to be what your popt patch fixes).  Since we want to support using
a shared popt library, that means that optional args can't be used.

Also, your changes to batch.c created an incompatible batch-file format.  To
remain compatible, you need to make sure that the existing 0 and 1 values in
batch files continue to mean what 0 and -1 mean in your patch.
Comment 3 Wayne Davison 2005-10-17 13:59:09 UTC
Created attachment 1520 [details]
My version of adding optional compression-level selection

Here's a patch that should accomplish the same thing, while avoiding the
problems I mentioned above.
Comment 4 Wayne Davison 2005-10-26 09:46:30 UTC
The --compress-level option was committed to CVS.
Comment 5 Paul Ripke 2005-11-05 23:58:22 UTC
I've tested the changes, which were actually very similar to my first pass at a
patch which we've been using for almost a year on production systems (rsyncing
live Oracle databases between continents). I decided against the
--compress-level option as it breaks if rsync is too old on the other end, and I
was trying to allow older versions to skip the option transparently.

Regardless, so long as the ability to change the compression ability is allowed,
I don't mind how it is implemented. Thanks!