From: Stefano Zacchiroli Date: Fri, 10 Jan 2003 09:12:58 +0000 (+0000) Subject: - fixed typo: use Param_not_found exception from Http_types X-Git-Tag: v0_3_99~45 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=77994a44a78f2a0a510296bdc2ec8c9cf882b222;p=helm.git - fixed typo: use Param_not_found exception from Http_types - enabled logging by default - log IP of incoming connections --- diff --git a/helm/uwobo/src/ocaml/uwobo.ml b/helm/uwobo/src/ocaml/uwobo.ml index 22714b29a..abe65f47c 100644 --- a/helm/uwobo/src/ocaml/uwobo.ml +++ b/helm/uwobo/src/ocaml/uwobo.ml @@ -34,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 *) @@ -133,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 *) @@ -171,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" -> @@ -247,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