X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=daemons%2Fwhelp%2FsearchEngine.ml;h=8524588ca76ea9b4c557ca266242c2ed98f6a390;hb=63ac9d7bc2ea4690c50dfb7e6648db4698a9fe72;hp=e1e08bd4b7bb831fce50df58a3717b0ba28f081d;hpb=13187c20428b720dee4cdf4282f53f7d4666c455;p=helm.git diff --git a/daemons/whelp/searchEngine.ml b/daemons/whelp/searchEngine.ml index e1e08bd4b..8524588ca 100644 --- a/daemons/whelp/searchEngine.ml +++ b/daemons/whelp/searchEngine.ml @@ -357,9 +357,8 @@ let exec_action dbd (req: Http_types.request) outchan = end in let module Disambiguate' = Disambiguate.Make(Chat) in -prerr_endline "VOVI"; - let ast = Grammar.Entry.parse CicNotationParser.term (Stream.of_string term_str) in -prerr_endline "VIVO"; + let ast = + CicNotationParser.parse_term (Ulexing.from_utf8_string term_str) in let (id_to_uris, metasenv, term) = match Disambiguate'.disambiguate_term ~dbd ~context ~metasenv @@ -404,7 +403,7 @@ prerr_endline "VIVO"; ^ " 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 @@ -482,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" @@ -500,10 +494,10 @@ let restore_environment () = printf "done!\n"; flush stdout let read_notation () = - CicNotation2.load_notation ~include_paths:[] - (Helm_registry.get "search_engine.notations"); - CicNotation2.load_notation ~include_paths:[] - (Helm_registry.get "search_engine.interpretations") + ignore (CicNotation2.load_notation ~include_paths:[] + (Helm_registry.get "search_engine.notations")); + ignore (CicNotation2.load_notation ~include_paths:[] + (Helm_registry.get "search_engine.interpretations")) let _ = printf "%s started and listening on port %d\n" daemon_name port; @@ -520,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