From 9556cabc139d3e43817afffcab83f52b7c0a13bd Mon Sep 17 00:00:00 2001 From: octachron Date: Thu, 4 Feb 2021 15:28:01 +0100 Subject: [PATCH] Send Z_FINISH to stream when closing the input --- src/IO_gzip.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/IO_gzip.ml b/src/IO_gzip.ml index f0ecb9c..487d765 100644 --- a/src/IO_gzip.ml +++ b/src/IO_gzip.ml @@ -91,6 +91,11 @@ let encode ?(buf_size=4096 * 32) (oc:Out.t) : Out.t = Bytes.set buf0 0 c; write buf0 0 1 and close() = + ignore @@ Zlib.deflate zlib_str + buf0 0 0 + w_buf 0 buf_size + Zlib.Z_FINISH + ; Zlib.deflate_end zlib_str; Out.close oc in