X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fuwobo%2Fsrc%2Focaml%2Fuwobo.ml;h=abe65f47c135753548e7956a1cde734ce27dde00;hb=285f5b4454e34023e57b21d4b6b908979aa79a69;hp=4a4d28470c6e06f63ff602e72bc81d948ddc46f9;hpb=9bd5d6f57b26908d53c1fad8a349602dc3434956;p=helm.git diff --git a/helm/uwobo/src/ocaml/uwobo.ml b/helm/uwobo/src/ocaml/uwobo.ml index 4a4d28470..abe65f47c 100644 --- a/helm/uwobo/src/ocaml/uwobo.ml +++ b/helm/uwobo/src/ocaml/uwobo.ml @@ -24,6 +24,9 @@ * http://cs.unibo.it/helm/. *) +(* TODO braindead situation: /add of a stylesheet which uri is an uwobo +invocation *) + open Printf;; open Uwobo_common;; @@ -31,7 +34,7 @@ open Uwobo_common;; let debug = true;; let debug_level = `Debug;; let debug_print s = if debug then prerr_endline s;; -let http_debug = false;; +let http_debug = true;; Http_common.debug := http_debug;; (* environment settings *) @@ -130,7 +133,7 @@ let callback req outchan = let keys = try Pcre.split ~pat:"," (req#param "keys") - with Http_request.Param_not_found _ -> [] + with Http_types.Param_not_found _ -> [] in (match keys with | [] -> (* no key provided, act on all stylesheets *) @@ -168,6 +171,7 @@ let callback req outchan = ((fun _ -> []), []) (* no parameters, no properties *) in try + syslogger#log `Notice (sprintf "Connection from %s" req#clientAddr); syslogger#log `Debug (sprintf "Received request: %s" req#path); (match req#path with | "/add" -> @@ -244,7 +248,7 @@ let callback req outchan = | invalid_request -> Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan) with - | Http_request.Param_not_found attr_name -> + | Http_types.Param_not_found attr_name -> bad_request (sprintf "Parameter '%s' is missing" attr_name) outchan | exc -> Http_daemon.respond @@ -257,6 +261,7 @@ syslogger#log `Notice (sprintf "%s started and listening on port %d" daemon_name port); syslogger#log `Notice (sprintf "current directory is %s" (Sys.getcwd ())); +Unix.putenv "http_proxy" ""; (* reset http_proxy to avoid libxslt problems *) Http_daemon.start' ~port ~mode:`Thread callback; syslogger#log `Notice (sprintf "%s is terminating, bye!" daemon_name)