]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/uwobo/uwobo.ml
ocaml 3.09 transition
[helm.git] / helm / uwobo / uwobo.ml
index d8341aeb6d924b3fd77cd979f75c492cd3cd1e33..1a5b44f620264f3c862bc09f3759b25c68dd311c 100644 (file)
@@ -517,6 +517,18 @@ let callback
         syslogger#log `Debug (sprintf "Parsing input document %s ..." xmluri);
         let domImpl = Gdome.domImplementation () in
         let input = domImpl#createDocumentFromURI ~uri:xmluri () in
+        if debug then begin
+          let tmp_xml, tmp_uri =
+            let dir =
+              Filename.dirname (Helm_registry.get "uwobo.log_basename")
+            in
+            dir ^ "/input.xml", dir ^ "/input.uri"
+          in
+          ignore (domImpl#saveDocumentToFile ~doc:input ~name:tmp_xml ());
+          let oc = open_out tmp_uri in
+          output_string oc xmluri;
+          close_out oc
+        end;
         syslogger#log `Debug "Applying stylesheet chain ...";
         (try
           let (write_result, media_type, encoding) = (* out_channel -> unit *)
@@ -772,9 +784,10 @@ let main () =
                   (sprintf "Ignoring invalid interprocess command: '%s'" cmd))
           done
         with
-          Restart_HTTP_daemon ->
+        | Restart_HTTP_daemon ->
             close_in cmd_pipe;  (* these calls close also fds *)
             close_out res_pipe
+         | Sys.Break as exn -> raise exn
         | e -> (* Should we return a 404 error here? Maybe... (how?) *)
            output_string res_pipe (Printexc.to_string e);
             close_in cmd_pipe;  (* these calls close also fds *)