From 9d04d8c478c68127fade09c220e983adbf492c15 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 16 Dec 2003 17:56:42 +0000 Subject: [PATCH] - ported to new output_html Disambiguate callback - removed netclient dependency --- helm/searchEngine/Makefile | 2 +- helm/searchEngine/searchEngine.ml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/helm/searchEngine/Makefile b/helm/searchEngine/Makefile index a2287e77d..e7b9555e4 100644 --- a/helm/searchEngine/Makefile +++ b/helm/searchEngine/Makefile @@ -1,6 +1,6 @@ REQUIRES = http helm-cic_textual_parser helm-cic_proof_checking \ helm-xml gdome2-xslt helm-cic_unification helm-mathql \ - helm-mathql_interpreter helm-mathql_generator netclient + helm-mathql_interpreter helm-mathql_generator OCAMLOPTIONS = -package "$(REQUIRES)" -pp camlp4o -I ../gTopLevel OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS) OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS) diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index 535b5f83f..a140666ac 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -345,7 +345,7 @@ let callback (req: Http_types.request) outchan = if List.mem server_and_port valid_servers then Http_daemon.respond ~headers:["Content-Type", "text/html"] - ~body:(Http_client.Convenience.http_get url) + ~body:(Http_client.http_get url) outchan else Http_daemon.respond @@ -413,7 +413,16 @@ List.iter (fun u -> prerr_endline ("<" ^ Netencoding.Url.decode u ^ ">")) tail; let set_metasenv metasenv = CicTextualParser0.metasenv := metasenv - let output_html = prerr_endline + let output_html ?(append_NL = true) html_msg = + let rec collect_string = function + | `BR -> "\n" + | `T s -> s + | `L tags -> String.concat "" (List.map collect_string tags) + in + match html_msg with + | `Error msg | `Msg msg -> + (if append_NL then prerr_endline else prerr_string) + (collect_string msg ^ (if append_NL then "\n" else "")) let interactive_user_uri_choice ~selection_mode ?ok -- 2.39.2