^ " type")))
req outchan
-let callback (dbd, (req: Http_types.request), outchan) =
+let callback dbd (req: Http_types.request) outchan =
try
debug_print (sprintf "Received request: %s" req#path);
(match req#path with
let msg = MooglePp.pp_error "Uncaught exception" exn_string in
send_results (`Error msg) req outchan
-let callback dbd req ch =
- HExtlib.finally
- (fun () -> try close_out ch with Sys_error _ -> ())
- callback (dbd, req, ch)
-
let restore_environment () =
match
Helm_registry.get_opt Helm_registry.string "search_engine.environment_dump"
in
restore_environment ();
read_notation ();
- let d_spec = Http_daemon.daemon_spec ~port ~callback:(callback dbd) () in
+ let d_spec = Http_daemon.daemon_spec ~port ~callback:(callback dbd) ~auto_close:true () in
Http_daemon.main d_spec;
printf "%s is terminating, bye!\n" daemon_name