Some compression improvements.
The compression level of the first file in the transfer no longer sets
the level for all files that follow it. Document that per-file level
switching has no current effect (except for a global "dont compress = *"
rule in the daemon).
diff --git a/token.c b/token.c
index 3a6d069..20d10bc 100644
--- a/token.c
+++ b/token.c
@@ -39,7 +39,6 @@
#define Z_INSERT_ONLY Z_SYNC_FLUSH
#endif
-static int compression_level; /* The compression level for the current file. */
static int skip_compression_level; /* The least possible compressing for handling skip-compress files. */
static int per_file_default_level; /* The default level that each new file gets prior to checking its suffix. */
@@ -224,9 +223,11 @@
/* determine the compression level based on a wildcard filename list */
void set_compression(const char *fname)
{
+#if 0 /* No compression algorithms currently allow mid-stream changing of the level. */
const struct suffix_tree *node;
const char *s;
char ltr;
+#endif
if (!do_compression)
return;
@@ -234,6 +235,7 @@
if (!match_list)
init_set_compression();
+#if 0
compression_level = per_file_default_level;
if (!*match_list && !suftree)
@@ -270,6 +272,9 @@
if (!(node = node->child))
return;
}
+#else
+ (void)fname;
+#endif
}
/* non-compressing recv token */
@@ -361,7 +366,7 @@
tx_strm.next_in = NULL;
tx_strm.zalloc = NULL;
tx_strm.zfree = NULL;
- if (deflateInit2(&tx_strm, compression_level,
+ if (deflateInit2(&tx_strm, per_file_default_level,
Z_DEFLATED, -15, 8,
Z_DEFAULT_STRATEGY) != Z_OK) {
rprintf(FERROR, "compression init failed\n");