|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 04 of 17] [rpc-light] Add a function to parse XMLRPC fr
# 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 ++
xen-api-libs.hg-17.patch
Description: Text Data
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-API] [PATCH 00 of 17] Improvments to RPC-light, Thomas Gazagnaire
- [Xen-API] [PATCH 03 of 17] [rpc-light] test (un)marshalling of phatom types, Thomas Gazagnaire
- [Xen-API] [PATCH 01 of 17] [rpc-light] Make the abstraction layer more uniform, especially for the error handling, Thomas Gazagnaire
- [Xen-API] [PATCH 04 of 17] [rpc-light] Add a function to parse XMLRPC from an input channel,
Thomas Gazagnaire <=
- [Xen-API] [PATCH 06 of 17] [rpc-light] Add some basic RPC int functions, Thomas Gazagnaire
- [Xen-API] [PATCH 09 of 17] [rpc-light] Add some friendly error messages on runtime errors, Thomas Gazagnaire
- [Xen-API] [PATCH 08 of 17] [rpc-light] Add a function to marshal and unmarshal XMLRPC to a bigbuffer, Thomas Gazagnaire
- [Xen-API] [PATCH 07 of 17] [rpc-light] Add some basic RPC int functions, Thomas Gazagnaire
- [Xen-API] [PATCH 05 of 17] [rpc-light] Add some explicit runtime exceptions when an runtime error occurs, Thomas Gazagnaire
- [Xen-API] [PATCH 02 of 17] [rpc-light] Backport the value library and clean-up the Makefile and the library building, Thomas Gazagnaire
- [Xen-API] [PATCH 11 of 17] [rpc-light] Never call 'exit i' on error, because that's not good when you run it in a daemon, Thomas Gazagnaire
- [Xen-API] [PATCH 16 of 17] [rpc-light] when (un)marshaling variant, if it has no arguments then consider it as a string, Thomas Gazagnaire
- [Xen-API] [PATCH 17 of 17] [rpc-light] In xmlrpc, when waiting for a tag opening, do not pay attention to any DTD, Thomas Gazagnaire
- [Xen-API] [PATCH 14 of 17] [rpc-light] Protect the XML strings as xml-light2, Thomas Gazagnaire
|
|
|
|
|