From b27a738af7c28848a7c1bbf1374abfff2288010b 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 --- helm/software/daemons/proofChecker/proofChecker.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/helm/software/daemons/proofChecker/proofChecker.ml b/helm/software/daemons/proofChecker/proofChecker.ml index e4f00fe3a..c4a6391cc 100644 --- a/helm/software/daemons/proofChecker/proofChecker.ml +++ b/helm/software/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