Skip to content

Commit

Permalink
Merge pull request #981 from dkalinichenko-js/v2.5-base-compat
Browse files Browse the repository at this point in the history
v2.5 base v0.16 compat
  • Loading branch information
mseri committed Jun 6, 2023
2 parents a40873a + afdd585 commit 32ae4f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cohttp-async/bin/cohttp_server_async.ml
Expand Up @@ -50,7 +50,7 @@ let serve ~info ~docroot ~index uri path =
serve_file ~docroot ~uri
| `No | `Unknown -> (* Do a directory listing *)
Sys.ls_dir file_name
>>= Deferred.List.map ~f:(fun f ->
>>= Deferred.List.map ~how:`Parallel ~f:(fun f ->
let file_name = file_name / f in
try_with (fun () ->
Unix.stat file_name
Expand Down
2 changes: 1 addition & 1 deletion cohttp-async/src/body_raw.ml
Expand Up @@ -66,7 +66,7 @@ let write_body write_body (body : t) writer =
match body with
| `Empty -> return ()
| `String s -> write_body writer s
| `Strings sl -> Deferred.List.iter sl ~f:(write_body writer)
| `Strings sl -> Deferred.List.iter ~how:`Sequential sl ~f:(write_body writer)
| `Pipe p -> Pipe.iter p ~f:(write_body writer)

let pipe_of_body read_chunk ic =
Expand Down
8 changes: 4 additions & 4 deletions cohttp-async/src/io.ml
Expand Up @@ -19,7 +19,7 @@ open Async_kernel

module Writer = Async_unix.Writer
module Reader = Async_unix.Reader
module Format = Caml.Format
module Format = Stdlib.Format

let log_src_name = "cohttp.async.io"
let src = Logs.Src.create log_src_name ~doc:"Cohttp Async IO module"
Expand All @@ -41,7 +41,7 @@ let default_reporter () =
over ();
k () in
msgf @@ fun ?header:_ ?tags:_ fmt ->
Format.kfprintf k fmtr Caml.("@[" ^^ fmt ^^ "@]@.")
Format.kfprintf k fmtr Stdlib.("@[" ^^ fmt ^^ "@]@.")
in
{ Logs.report }

Expand All @@ -56,10 +56,10 @@ let set_log = lazy (
)

let check_debug norm_fn debug_fn =
match Caml.Sys.getenv "COHTTP_DEBUG" with
match Stdlib.Sys.getenv "COHTTP_DEBUG" with
| _ ->
Lazy.force set_log; debug_fn
| exception Caml.Not_found -> norm_fn
| exception Stdlib.Not_found -> norm_fn

type 'a t = 'a Deferred.t
let (>>=) = Deferred.(>>=)
Expand Down

0 comments on commit 32ae4f7

Please sign in to comment.