From d03cd65dcdbe99d230cac84f2100f74b427a8675 Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Thu, 1 Sep 2022 09:50:53 +0200 Subject: [PATCH] Fix a leak of fd from h2 - we must shutdown the connection to really close the fd --- mirage/http_mirage_client.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirage/http_mirage_client.ml b/mirage/http_mirage_client.ml index eb041b3..bb76d10 100644 --- a/mirage/http_mirage_client.ml +++ b/mirage/http_mirage_client.ml @@ -219,7 +219,8 @@ let single_h2_request ~sleep ?config ~scheme flow user_pass host meth path heade Lwt.async (fun () -> Paf.run (module H2.Client_connection) ~sleep conn flow) ; Option.iter (H2.Body.Writer.write_string request_body) body ; H2.Body.Writer.close request_body ; - finished + finished >|= fun v -> + H2.Client_connection.shutdown conn ; v let decode_uri ~ctx uri = let ( >>= ) = Result.bind in