diff --git a/async/cohttp_async.ml b/async/cohttp_async.ml index 198cb1fe6f..fa5897791d 100644 --- a/async/cohttp_async.ml +++ b/async/cohttp_async.ml @@ -155,6 +155,10 @@ module Client = struct | `Ok res -> (* Build a response pipe for the body *) let rd = pipe_of_body (Response.read_body_chunk res) ic oc in + don't_wait_for ( + Pipe.closed rd >>= fun () -> + Deferred.all_ignore [Reader.close ic; Writer.close oc] + ); return (res, `Pipe rd) let get ?interrupt ?headers uri =