X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FsearchEngine%2FsearchEngine.ml;h=a140666aca5d3d2434f78bcd6d3bac75592ed246;hb=ac0a12080b434bf0daafc08e9da240eb57f47280;hp=f7fae9481e6d0ac093705fa5fd21f7f50fba5dd7;hpb=36d9dada5eb3894d96c807781e1056b73a1c0a79;p=helm.git diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index f7fae9481..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 @@ -426,7 +435,7 @@ List.iter (fun u -> prerr_endline ("<" ^ Netencoding.Url.decode u ^ ">")) tail; let msg = Pcre.replace ~pat:"\'" ~templ:"\\\'" msg in (match selection_mode with | `SINGLE -> assert false - | `EXTENDED -> + | `MULTIPLE -> Http_daemon.send_basic_headers ~code:200 outchan ; Http_daemon.send_CRLF outchan ; iter_file