flush !outchan)
;;
-let callback (req : Http_types.request) outchan' =
+let callback ((req : Http_types.request), outchan') =
match req#path with
| "/proofCheck" ->
begin
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"