Browse Source

[mod_deflate] use ZSTD_c_strategy w/ compress lvl

map deflate.compression-level to ZSTD_c_strategy as the current
enum for ZSTD_strategy is in the range 1 .. 9, which matches the
gzip compression level 1 .. 9 range

x-ref:
  "ModDeflate questions (possibly some feature requests too)"
  https://redmine.lighttpd.net/boards/2/topics/9786
master
Glenn Strauss 6 months ago
parent
commit
777d659c5c
  1. 2
      src/mod_deflate.c

2
src/mod_deflate.c

@ -989,7 +989,7 @@ static int stream_zstd_init(handler_ctx *hctx) {
if (p->conf.compression_level >= 0) { /* -1 is lighttpd default for "unset" */
int level = p->conf.compression_level;
#if ZSTD_VERSION_NUMBER >= 10000+400+0 /* v1.4.0 */
ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level);
ZSTD_CCtx_setParameter(cctx, ZSTD_c_strategy, level);
#else
ZSTD_initCStream(cctx, level);
#endif

Loading…
Cancel
Save