X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fdaemons%2Fgraphs%2Ftools%2FdrawGraph.ml;fp=helm%2Fsoftware%2Fdaemons%2Fgraphs%2Ftools%2FdrawGraph.ml;h=f7c8174965c7b3f5fc190faa19b58ee226980d92;hb=9c62f882f0aa158c0954442fe544d85e68dd10c3;hp=c17902fbc551dd85e92f0a4a5315fee500d978f7;hpb=4d195c3ad2400605ca79e9dc97b4808286de994d;p=helm.git diff --git a/helm/software/daemons/graphs/tools/drawGraph.ml b/helm/software/daemons/graphs/tools/drawGraph.ml index c17902fbc..f7c817496 100644 --- a/helm/software/daemons/graphs/tools/drawGraph.ml +++ b/helm/software/daemons/graphs/tools/drawGraph.ml @@ -56,7 +56,7 @@ let string_of_exit_status = function | Unix.WSIGNALED n -> sprintf "Process killed by signal %d" n | Unix.WSTOPPED n -> sprintf "Process stopped by signal %d" n in -let callback (req: Http_types.request) outchan = +let callback ((req: Http_types.request), outchan) = try (match req#path with | "/draw" -> @@ -90,6 +90,11 @@ let callback (req: Http_types.request) outchan = ~body:(sprintf "Parameter '%s' is missing" attr_name) outchan in +let callback req ch = + HExtlib.finally + (fun () -> try close_out ch with Sys_error _ -> ()) + callback (req, ch) +in Helm_registry.load_from configuration_file; let port = Helm_registry.get_int "draw_graph.port" in Sys.chdir (Helm_registry.get "draw_graph.dir");