From 7e0402e738f2e3ff6d74e63283bc7c514b67b3a4 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Tue, 15 May 2018 13:13:19 -0400 Subject: [PATCH] Also Attach Dict When Source Size is Unknown --- lib/compress/zstd_compress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 9f488b9ac..4d4e171bc 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1208,7 +1208,8 @@ static size_t ZSTD_resetCCtx_usingCDict(ZSTD_CCtx* cctx, * context, or referencing the dictionary context from the working context * in-place. We decide here which strategy to use. */ /* TODO: pick reasonable cut-off size, handle ZSTD_CONTENTSIZE_UNKNOWN */ - int attachDict = pledgedSrcSize <= 8 KB + int attachDict = ( pledgedSrcSize <= 8 KB + || pledgedSrcSize == ZSTD_CONTENTSIZE_UNKNOWN ) && cdict->cParams.strategy == ZSTD_fast && ZSTD_equivalentCParams(cctx->appliedParams.cParams, cdict->cParams);