mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
fix
This commit is contained in:
parent
4705278c3b
commit
3cdec1c0c7
1 changed files with 8 additions and 1 deletions
|
|
@ -348,7 +348,14 @@ module Input = struct
|
||||||
method private refill (slice : Slice.t) : unit =
|
method private refill (slice : Slice.t) : unit =
|
||||||
if !chunk_size = 0 && not !eof then (
|
if !chunk_size = 0 && not !eof then (
|
||||||
chunk_size := read_next_chunk_len ();
|
chunk_size := read_next_chunk_len ();
|
||||||
if !chunk_size = 0 then eof := true (* stream is finished *)
|
if !chunk_size = 0 then (
|
||||||
|
(* stream is finished, consume trailing \r\n *)
|
||||||
|
eof := true;
|
||||||
|
let line = read_line_using ~buf:line_buf ic in
|
||||||
|
if String.trim line <> "" then
|
||||||
|
raise
|
||||||
|
(fail (spf "expected \\r\\n to follow last chunk, got %S" line))
|
||||||
|
)
|
||||||
);
|
);
|
||||||
slice.off <- 0;
|
slice.off <- 0;
|
||||||
slice.len <- 0;
|
slice.len <- 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue