]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/uwobo/src/ocaml/uwobo.ml
rebuilt
[helm.git] / helm / uwobo / src / ocaml / uwobo.ml
index 22714b29a837b6ba18bcb3edb144a5b3b2590568..c99b4907c9573929c7f16b6d3a67a188b5068ac4 100644 (file)
@@ -125,15 +125,17 @@ let usage_string =
 in
 
   (* thread action *)
-let callback req outchan =
+let callback (req: Http_types.request) outchan =
     (* perform an 'action' that can be applied to a list of keys or, if no
     keys was given, to all keys *)
-  let act_on_keys req styles outchan per_key_action all_keys_action logmsg =
+  let act_on_keys (req: Http_types.request)
+    styles outchan per_key_action all_keys_action logmsg
+    =
     let log = new Uwobo_logger.processingLogger () in
     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 +173,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" ->
@@ -245,9 +248,10 @@ let callback req outchan =
               outchan)
     | "/help" -> Http_daemon.respond ~body:usage_string outchan
     | invalid_request ->
-        Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan)
+        Http_daemon.respond_error ~status:(`Client_error `Bad_request) outchan);
+    syslogger#log `Debug (sprintf "%s done!" req#path);
   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