mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
Merge branch 'c-cube:master' into client-ip
This commit is contained in:
commit
0a111c8cdb
1 changed files with 3 additions and 3 deletions
|
|
@ -4,10 +4,10 @@ let serve_zeroes server : unit =
|
|||
H.add_route_handler server H.(Route.(exact "zeroes" @/ int @/ return))
|
||||
@@ fun n _req ->
|
||||
(* stream [n] zeroes *)
|
||||
let write (oc : H.IO.Out_channel.t) : unit =
|
||||
let write (oc : H.IO.Output.t) : unit =
|
||||
let buf = Bytes.make 1 '0' in
|
||||
for _i = 1 to n do
|
||||
H.IO.Out_channel.output oc buf 0 1
|
||||
H.IO.Output.output oc buf 0 1
|
||||
done
|
||||
in
|
||||
let writer = H.IO.Writer.make ~write () in
|
||||
|
|
@ -24,7 +24,7 @@ let serve_file server : unit =
|
|||
Fun.protect ~finally:(fun () -> close_in_noerr ic) @@ fun () ->
|
||||
while
|
||||
let n = input ic buf 0 (Bytes.length buf) in
|
||||
if n > 0 then H.IO.Out_channel.output oc buf 0 n;
|
||||
if n > 0 then H.IO.Output.output oc buf 0 n;
|
||||
n > 0
|
||||
do
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue