mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
refactor zlib
This commit is contained in:
parent
e6b46379c0
commit
c2fb67615d
1 changed files with 2 additions and 3 deletions
|
|
@ -20,11 +20,10 @@ let mk_decode_deflate_stream_ () (is:S.byte_stream) : S.byte_stream =
|
||||||
len !buf_len
|
len !buf_len
|
||||||
);
|
);
|
||||||
write_offset := !write_offset + len;
|
write_offset := !write_offset + len;
|
||||||
buf_len := !buf_len - len;
|
|
||||||
in
|
in
|
||||||
let bs_fill_buf () : _*_*_ =
|
let bs_fill_buf () : _*_*_ =
|
||||||
(* refill [buf] if needed *)
|
(* refill [buf] if needed *)
|
||||||
if !buf_len = 0 && not !is_done then (
|
if !write_offset >= !buf_len && not !is_done then (
|
||||||
let ib, ioff, ilen = is.S.bs_fill_buf () in
|
let ib, ioff, ilen = is.S.bs_fill_buf () in
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
|
@ -45,7 +44,7 @@ let mk_decode_deflate_stream_ () (is:S.byte_stream) : S.byte_stream =
|
||||||
end;
|
end;
|
||||||
S._debug (fun k->k "inflate: refill %d bytes into internal buf" !buf_len);
|
S._debug (fun k->k "inflate: refill %d bytes into internal buf" !buf_len);
|
||||||
);
|
);
|
||||||
buf, !write_offset, !buf_len
|
buf, !write_offset, !buf_len - !write_offset
|
||||||
in
|
in
|
||||||
{S.bs_fill_buf; bs_consume; bs_close}
|
{S.bs_fill_buf; bs_consume; bs_close}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue