From 5740d19b557e3ebef620017bbd85bdea22dda28c Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Mon, 29 May 2006 17:13:03 +0000 Subject: [PATCH] ensure connections get closed after having been served --- daemons/proofChecker/proofChecker.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/daemons/proofChecker/proofChecker.ml b/daemons/proofChecker/proofChecker.ml index e4f00fe3a..c4a6391cc 100644 --- a/daemons/proofChecker/proofChecker.ml +++ b/daemons/proofChecker/proofChecker.ml @@ -92,7 +92,7 @@ let _ = flush !outchan) ;; -let callback (req : Http_types.request) outchan' = +let callback ((req : Http_types.request), outchan') = match req#path with | "/proofCheck" -> begin @@ -125,6 +125,13 @@ let callback (req : Http_types.request) outchan' = in +let callback req ch = + HExtlib.finally + (fun () -> try close_out ch with Sys_error _ -> ()) + callback (req, ch) + +in + printf "Proof Checker started and listening on port %d\n" port; flush stdout; CicEnvironment.set_trust (fun _ -> false); -- 2.39.2