From 9864c53b95446b10f0fa6eadc91a06fdb32c3abb Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 15 Mar 2024 11:04:16 -0400 Subject: [PATCH] wip --- src/camlzip/Tiny_httpd_camlzip.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camlzip/Tiny_httpd_camlzip.ml b/src/camlzip/Tiny_httpd_camlzip.ml index 4e8f5172..c15a3158 100644 --- a/src/camlzip/Tiny_httpd_camlzip.ml +++ b/src/camlzip/Tiny_httpd_camlzip.ml @@ -1,7 +1,5 @@ module W = IO.Writer -(* TODO: just use iostream-camlzip? *) - let decode_deflate_stream_ ~buf_size (ic : IO.Input.t) : IO.Input.t = Log.debug (fun k -> k "wrap stream with deflate.decode"); Iostream_camlzip.decompress_in_buf ~buf_size ic @@ -12,7 +10,9 @@ let encode_deflate_writer_ ~buf_size (w : W.t) : W.t = let { IO.Writer.write } = w in let write' (oc : IO.Output.t) = let oc' = Iostream_camlzip.compressed_out ~buf_size ~level:4 oc in - write (oc' :> IO.Output.t) + write (oc' :> IO.Output.t); + IO.Output.flush oc'; + IO.Output.close oc' in IO.Writer.make ~write:write' ()