mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
wip
This commit is contained in:
parent
78ded146ac
commit
9864c53b95
1 changed files with 3 additions and 3 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
module W = IO.Writer
|
module W = IO.Writer
|
||||||
|
|
||||||
(* TODO: just use iostream-camlzip? *)
|
|
||||||
|
|
||||||
let decode_deflate_stream_ ~buf_size (ic : IO.Input.t) : IO.Input.t =
|
let decode_deflate_stream_ ~buf_size (ic : IO.Input.t) : IO.Input.t =
|
||||||
Log.debug (fun k -> k "wrap stream with deflate.decode");
|
Log.debug (fun k -> k "wrap stream with deflate.decode");
|
||||||
Iostream_camlzip.decompress_in_buf ~buf_size ic
|
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 { IO.Writer.write } = w in
|
||||||
let write' (oc : IO.Output.t) =
|
let write' (oc : IO.Output.t) =
|
||||||
let oc' = Iostream_camlzip.compressed_out ~buf_size ~level:4 oc in
|
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
|
in
|
||||||
IO.Writer.make ~write:write' ()
|
IO.Writer.make ~write:write' ()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue