X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=daemons%2FproofChecker%2FproofChecker.ml;h=928881373470067ba133aafdb34fb76427809d30;hb=29bde16fc56dc6aeab6bce0d34705b8c58b05bd6;hp=e4f00fe3acf86c989b4e250af89000fda4942206;hpb=8feb1cda5703daa4371c556593bab63514423a58;p=helm.git diff --git a/daemons/proofChecker/proofChecker.ml b/daemons/proofChecker/proofChecker.ml index e4f00fe3a..928881373 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,9 +125,17 @@ 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); -Http_daemon.start' ~port ~mode:`Fork callback ; +let d_spec = Http_daemon.daemon_spec ~port ~mode:`Fork ~callback () in +Http_daemon.main d_spec; printf "Proof Checker is terminating, bye!\n"