|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] [PATCH 04 of 17] [rpc-light] Add a function to parse XMLRPC from an input channel
# HG changeset patch
# User Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
# Date 1262958466 0
# Node ID 91091e97839df807f73ddbd9ff40ab1e13d7753d
# Parent b1d07ffe0323c8e7384c2c7042098d12dac2eb23
[rpc-light] Add a function to parse XMLRPC from an input channel.
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
diff -r b1d07ffe0323 -r 91091e97839d rpc-light/xmlrpc.ml
--- a/rpc-light/xmlrpc.ml Fri Jan 08 13:47:46 2010 +0000
+++ b/rpc-light/xmlrpc.ml Fri Jan 08 13:47:46 2010 +0000
@@ -259,8 +259,7 @@
) input;
call !name (List.rev !params)
-let response_of_string ?callback str =
- let input = Xmlm.make_input (`String (0, str)) in
+let response_of_input ?callback input =
begin match Xmlm.peek input with
| `Dtd _ -> ignore (Xmlm.input input)
| _ -> () end;
@@ -274,4 +273,10 @@
) input
) input
-
+let response_of_string ?callback str =
+ let input = Xmlm.make_input (`String (0, str)) in
+ response_of_input ?callback input
+
+let response_of_in_channel ?callback chan =
+ let input = Xmlm.make_input (`Channel chan) in
+ response_of_input ?callback input
diff -r b1d07ffe0323 -r 91091e97839d rpc-light/xmlrpc.mli
--- a/rpc-light/xmlrpc.mli Fri Jan 08 13:47:46 2010 +0000
+++ b/rpc-light/xmlrpc.mli Fri Jan 08 13:47:46 2010 +0000
@@ -19,4 +19,6 @@
val call_of_string: ?callback:Rpc.callback -> string -> Rpc.call
val string_of_response: Rpc.response -> string
+
val response_of_string: ?callback:Rpc.callback -> string -> Rpc.response
+val response_of_in_channel: ?callback:Rpc.callback -> in_channel ->
Rpc.response
2 files changed, 10 insertions(+), 3 deletions(-)
rpc-light/xmlrpc.ml | 11 ++++++++---
rpc-light/xmlrpc.mli | 2 ++
Attachment:
xen-api-libs.hg-17.patch _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |