X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=daemons%2Fwhelp%2FsearchEngine.ml;h=8524588ca76ea9b4c557ca266242c2ed98f6a390;hb=218a5af368cb7ea58c59cad2e7c8ef1f733792c2;hp=fc49116196d4cb96ff0518d43527e76ab27ef753;hpb=d2a9e9b78b214663fb0e21eed95b21c5ab7119c6;p=helm.git diff --git a/daemons/whelp/searchEngine.ml b/daemons/whelp/searchEngine.ml index fc4911619..8524588ca 100644 --- a/daemons/whelp/searchEngine.ml +++ b/daemons/whelp/searchEngine.ml @@ -403,7 +403,7 @@ let exec_action dbd (req: Http_types.request) outchan = ^ " 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 @@ -481,11 +481,6 @@ let callback (dbd, (req: Http_types.request), outchan) = 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" @@ -519,7 +514,7 @@ let _ = 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