*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
- * Copyright (C) 2003-2020 Wayne Davison
+ * Copyright (C) 2003-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#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. */
break;
#endif
default: /* paranoia to prevent missing case values */
- assert(0);
+ NOISY_DEATH("Unknown do_compression value");
}
if (do_compression_level == CLVL_NOT_SPECIFIED)
/* 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;
if (!match_list)
init_set_compression();
+#if 0
compression_level = per_file_default_level;
if (!*match_list && !suftree)
if (!(node = node->child))
return;
}
+#else
+ (void)fname;
+#endif
}
/* non-compressing recv token */
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");
rx_strm.avail_in = 4;
rx_strm.next_in = (Bytef *)cbuf;
cbuf[0] = cbuf[1] = 0;
- cbuf[2] = cbuf[3] = 0xff;
+ cbuf[2] = cbuf[3] = (char)0xff;
inflate(&rx_strm, Z_SYNC_FLUSH);
recv_state = r_idle;
}
break;
#endif
default:
- assert(0);
+ NOISY_DEATH("Unknown do_compression value");
}
}
return recv_compressed_token(f, data);
#endif
default:
- assert(0);
+ NOISY_DEATH("Unknown do_compression value");
}
}
break;
case CPRES_ZLIBX:
break;
-#ifdef SUPPORT_LZ4
- case CPRES_LZ4:
- /*see_uncompressed_token(data, toklen);*/
+#ifdef SUPPORT_ZSTD
+ case CPRES_ZSTD:
break;
#endif
#ifdef SUPPORT_LZ4
- case CPRES_ZSTD:
+ case CPRES_LZ4:
+ /*see_uncompressed_token(data, toklen);*/
break;
#endif
default:
- assert(0);
+ NOISY_DEATH("Unknown do_compression value");
}
}