From de7acbaf6da0079b79d8c274e38e607f3c920a7e Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 3 Dec 2019 17:19:31 -0600 Subject: [PATCH] refactor: logerror when closing client socket --- src/Tiny_httpd.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tiny_httpd.ml b/src/Tiny_httpd.ml index 0cc9fe62..b2012fd4 100644 --- a/src/Tiny_httpd.ml +++ b/src/Tiny_httpd.ml @@ -735,10 +735,10 @@ let handle_client_ (self:t) (client_sock:Unix.file_descr) : unit = continue := false | exception Sys_error _ -> continue := false; (* connection broken somehow *) - Unix.close client_sock; done; _debug (fun k->k "done with client, exiting"); - (try Unix.close client_sock with _ -> ()); + (try Unix.close client_sock + with e -> _debug (fun k->k "error when closing sock: %s" (Printexc.to_string e))); () let is_ipv6 self = String.contains self.addr ':'