(** accepted HTTP servers for ask_uwobo method forwarding *)
let valid_servers = [ "mowgli.cs.unibo.it:58080" ; "mowgli.cs.unibo.it" ; "localhost:58080" ] ;;
(** accepted HTTP servers for ask_uwobo method forwarding *)
let valid_servers = [ "mowgli.cs.unibo.it:58080" ; "mowgli.cs.unibo.it" ; "localhost:58080" ] ;;
let callback (req: Http_types.request) outchan =
try
debug_print (sprintf "Received request: %s" req#path);
let callback (req: Http_types.request) outchan =
try
debug_print (sprintf "Received request: %s" req#path);
let query_string = req#param "query" in
let lexbuf = Lexing.from_string query_string in
let query = MQueryUtil.query_of_text lexbuf in
let query_string = req#param "query" in
let lexbuf = Lexing.from_string query_string in
let query = MQueryUtil.query_of_text lexbuf in
Http_daemon.respond ~headers:[contype] ~body:(pp_result result) outchan
| "/getpage" ->
(* TODO implement "is_permitted" *)
Http_daemon.respond ~headers:[contype] ~body:(pp_result result) outchan
| "/getpage" ->
(* TODO implement "is_permitted" *)
let term_string = req#param "term" in
let lexbuf = Lexing.from_string term_string in
let (context, metasenv) = ([], []) in
let term_string = req#param "term" in
let lexbuf = Lexing.from_string term_string in
let (context, metasenv) = ([], []) in
in
let module Disambiguate' = Disambiguate.Make (Chat) in
let (id_to_uris', metasenv', term') =
in
let module Disambiguate' = Disambiguate.Make (Chat) in
let (id_to_uris', metasenv', term') =
context metasenv dom mk_metasenv_and_expr id_to_uris
in
(match metasenv' with
| [] ->
let must',only = get_constraints term' req#path in
context metasenv dom mk_metasenv_and_expr id_to_uris
in
(match metasenv' with
| [] ->
let must',only = get_constraints term' req#path in
debug_print (sprintf "%s done!" req#path)
with
| Chat_unfinished -> prerr_endline "Chat unfinished, Try again!"
debug_print (sprintf "%s done!" req#path)
with
| Chat_unfinished -> prerr_endline "Chat unfinished, Try again!"