From: Stefano Zacchiroli Date: Fri, 10 Jan 2003 09:10:34 +0000 (+0000) Subject: - moved here respond_exc and respond_msg from broker/ X-Git-Tag: v0_3_99~48 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=5a666b3edf51534f2f41f4bd27e6678ed5a05340;p=helm.git - moved here respond_exc and respond_msg from broker/ --- diff --git a/helm/hbugs/common/hbugs_messages.ml b/helm/hbugs/common/hbugs_messages.ml index d0a6fe1db..0eac0b149 100644 --- a/helm/hbugs/common/hbugs_messages.ml +++ b/helm/hbugs/common/hbugs_messages.ml @@ -213,4 +213,8 @@ let string_of_msg = function let submit_req ~url msg = msg_of_string (Hbugs_misc.http_post ~body:(string_of_msg msg) url) +let return_xml_msg body outchan = + Http_daemon.respond ~headers:["Content-Type", "text/xml"] ~body outchan +let respond_msg msg = return_xml_msg (string_of_msg msg);; +let respond_exc name value = respond_msg (Exception (name, value));; diff --git a/helm/hbugs/common/hbugs_messages.mli b/helm/hbugs/common/hbugs_messages.mli index 1ab0e9400..d035dcff1 100644 --- a/helm/hbugs/common/hbugs_messages.mli +++ b/helm/hbugs/common/hbugs_messages.mli @@ -28,8 +28,13 @@ open Hbugs_types;; +exception Parse_error of string * string (* parsing subject, reason *) + val msg_of_string: string -> message val string_of_msg: message -> string val submit_req: url:string -> message -> message +val respond_msg: message -> out_channel -> unit + (* exception_name, exception_value, output_channel *) +val respond_exc: string -> string -> out_channel -> unit