From 8db1379a19bafaf18bb42cd95c4aca87753192dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20Van=C4=9Bk?= Date: Fri, 8 Apr 2022 17:19:44 +0200 Subject: [PATCH] Migrate ZSTD_reset{C,D}Stream to a new API ZSTD_reset{C,D}Stream functions are deprecated since 1.4.0 version. This change migrates them to a new equivalents as described in documentation. --- src/libserver/cfg_utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 9a96f363c..e2dfd1d1b 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -2860,7 +2860,7 @@ rspamd_libs_reset_decompression (struct rspamd_external_libs_ctx *ctx) return FALSE; } else { - r = ZSTD_resetDStream (ctx->in_zstream); + r = ZSTD_DCtx_reset (ctx->in_zstream, ZSTD_reset_session_only); if (ZSTD_isError (r)) { msg_err ("cannot init decompression stream: %s", @@ -2885,7 +2885,10 @@ rspamd_libs_reset_compression (struct rspamd_external_libs_ctx *ctx) } else { /* Dictionary will be reused automatically if specified */ - r = ZSTD_resetCStream (ctx->out_zstream, 0); + r = ZSTD_CCtx_reset (ctx->out_zstream, ZSTD_reset_session_only); + if (!ZSTD_isError (r)) { + r = ZSTD_CCtx_setPledgedSrcSize (ctx->out_zstream, 0); + } if (ZSTD_isError (r)) { msg_err ("cannot init compression stream: %s", -- 2.39.5