X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FsearchEngine%2FsearchEngine.ml;h=87bcad36a42bc9b42d4985bdb7c4368410f7e0b3;hb=e76b78d1d80796de1b8f6a469741cbd26cd4d822;hp=1762e5fd9f161f4da5409a3526abbdcfd953da66;hpb=9226222b139844ebae3bddd6aef489d60e41e27a;p=helm.git
diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml
index 1762e5fd9..87bcad36a 100644
--- a/helm/searchEngine/searchEngine.ml
+++ b/helm/searchEngine/searchEngine.ml
@@ -166,7 +166,8 @@ let port = Helm_registry.get_int "search_engine.port";;
let pp_error = sprintf "
Error: %s
";;
let bad_request body outchan =
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) ~body outchan
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request)) ~body
+ outchan
;;
let contype = "Content-Type", "text/html";;
@@ -305,7 +306,7 @@ let callback mqi_handle (req: Http_types.request) outchan =
(match page with
| page when is_permitted page ->
(let fname = sprintf "%s/%s" pages_dir (remove_fragment page) in
- Http_daemon.send_basic_headers ~code:200 outchan;
+ Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
Http_daemon.send_header "Content-Type" "text/html" outchan;
Http_daemon.send_CRLF outchan;
if preprocess then begin
@@ -397,13 +398,14 @@ let callback mqi_handle (req: Http_types.request) outchan =
(match selection_mode with
| `SINGLE -> assert false
| `MULTIPLE ->
- Http_daemon.send_basic_headers ~code:200 outchan ;
+ Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
Http_daemon.send_CRLF outchan ;
iter_file
(fun line ->
let formatted_choices =
String.concat ","
- (List.map (fun uri -> sprintf "\'%s\'" uri) choices)
+ (List.map (fun uri -> sprintf "\'%s\'" uri)
+ choices)
in
let processed_line =
apply_substs
@@ -445,7 +447,7 @@ let callback mqi_handle (req: Http_types.request) outchan =
in
String.concat ", " (aux 0 interpretations)
in
- Http_daemon.send_basic_headers ~code:200 outchan ;
+ Http_daemon.send_basic_headers ~code:(`Code 200) outchan ;
Http_daemon.send_CRLF outchan ;
iter_file
(fun line ->
@@ -459,8 +461,8 @@ let callback mqi_handle (req: Http_types.request) outchan =
interactive_interpretation_choice_TPL;
raise Chat_unfinished
- let input_or_locate_uri ~title =
- UriManager.uri_of_string "cic:/Coq/Init/DataTypes/nat_ind.con"
+ let input_or_locate_uri ~title ?id () =
+ assert false
end
in
@@ -526,15 +528,18 @@ let callback mqi_handle (req: Http_types.request) outchan =
"Only constraints
" ^
"Enforce Only constraints for objects: " ^
"
" ^
+ (if only_obj = None then "" else " checked='yes'") ^
+ " />
" ^
"Enforce Rel constraints for objects: " ^
"
" ^
+ (if only_rel = None then "" else " checked='yes'") ^
+ " />
" ^
"Enforce Sort constraints for objects: " ^
"
"
+ (if only_sort = None then "" else " checked='yes'") ^
+ " />
"
in
- Http_daemon.send_basic_headers ~code:200 outchan ;
+ Http_daemon.send_basic_headers ~code:(`Code 200) outchan ;
Http_daemon.send_CRLF outchan ;
iter_file
(fun line ->
@@ -551,7 +556,7 @@ let callback mqi_handle (req: Http_types.request) outchan =
G.query_of_constraints universe must'' only'
in
let results = MQueryInterpreter.execute mqi_handle query in
- Http_daemon.send_basic_headers ~code:200 outchan ;
+ Http_daemon.send_basic_headers ~code:(`Code 200) outchan ;
Http_daemon.send_CRLF outchan ;
iter_file
(fun line ->
@@ -567,7 +572,8 @@ let callback mqi_handle (req: Http_types.request) outchan =
output_string outchan (processed_line ^ "\n"))
final_results_TPL
| invalid_request ->
- Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan);
+ Http_daemon.respond_error ~code:(`Status (`Client_error `Bad_request))
+ outchan);
debug_print (sprintf "%s done!" req#path)
with
| Chat_unfinished -> prerr_endline "Chat unfinished, Try again!"