diff --git a/cohttp-async/src/server.ml b/cohttp-async/src/server.ml index d269641c95..c3c1fa209f 100644 --- a/cohttp-async/src/server.ml +++ b/cohttp-async/src/server.ml @@ -87,14 +87,14 @@ let handle_client handle_request sock rd wr = Body.drain body >>| fun () -> Ivar.fill_if_empty finished () | `Response (req, body, (res, res_body)) -> (* There are scenarios if a client leaves before consuming the full response, - we might have a reference to an async Pipe that doesn't get drained. + we might have a reference to an async Pipe that doesn't get drained. - Not draining or closing a pipe can lead to issues if its holding a resource like - a file handle as those resources will never be closed, leading to a leak. + Not draining or closing a pipe can lead to issues if its holding a resource like + a file handle as those resources will never be closed, leading to a leak. - Async writers have a promise that's fulfilled whenever they are closed, - so we can use it to schedule a close operation on the stream to ensure that we - don't leave a stream open if the underlying channels are closed. *) + Async writers have a promise that's fulfilled whenever they are closed, + so we can use it to schedule a close operation on the stream to ensure that we + don't leave a stream open if the underlying channels are closed. *) (match res_body with | `Empty | `String _ | `Strings _ -> () | `Pipe stream -> diff --git a/cohttp-async/test/test_async_integration.ml b/cohttp-async/test/test_async_integration.ml index 32a2a6aa79..767d925c64 100644 --- a/cohttp-async/test/test_async_integration.ml +++ b/cohttp-async/test/test_async_integration.ml @@ -111,7 +111,8 @@ let ts = ("Pipe with empty strings", Pipe.of_list [ ""; ""; "" ], true); ] in - Deferred.List.iter ~how:`Sequential tests ~f:(fun (msg, pipe, expected) -> + Deferred.List.iter ~how:`Sequential tests + ~f:(fun (msg, pipe, expected) -> is_empty (`Pipe pipe) >>| fun real -> assert_equal ~msg expected real) >>= fun () -> diff --git a/cohttp-lwt-unix/bin/dune b/cohttp-lwt-unix/bin/dune index b8ae61a03e..63e95e9032 100644 --- a/cohttp-lwt-unix/bin/dune +++ b/cohttp-lwt-unix/bin/dune @@ -1,14 +1,6 @@ (executables (names cohttp_curl_lwt cohttp_proxy_lwt cohttp_server_lwt) - (libraries - cohttp-lwt-unix - cohttp_server - logs - logs.lwt - logs.fmt - logs.cli - cmdliner - conduit-lwt - fmt.tty) + (libraries cohttp-lwt-unix cohttp_server logs logs.lwt logs.fmt logs.cli + cmdliner conduit-lwt fmt.tty) (package cohttp-lwt-unix) (public_names cohttp-curl-lwt cohttp-proxy-lwt cohttp-server-lwt)) diff --git a/examples/async/dune b/examples/async/dune index 8d875ddcbd..109a31026d 100644 --- a/examples/async/dune +++ b/examples/async/dune @@ -1,6 +1,7 @@ (executables (names hello_world receive_post s3_cp) - (libraries mirage-crypto cohttp-async base async_kernel core_unix.command_unix)) + (libraries mirage-crypto cohttp-async base async_kernel + core_unix.command_unix)) (alias (name runtest) diff --git a/examples/async/s3_cp.ml b/examples/async/s3_cp.ml index 48a6f6482a..735dcafb44 100644 --- a/examples/async/s3_cp.ml +++ b/examples/async/s3_cp.ml @@ -44,7 +44,6 @@ open Core open Async open Cohttp open Cohttp_async - module Time = Time_float let ksrt (k, _) (k', _) = String.compare k k'