]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
[rpc-light] Add a function to parse XMLRPC from an input channel.
authorThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
committerThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
rpc-light/xmlrpc.ml
rpc-light/xmlrpc.mli

index 566281c9fc9529be4b7a157ce2d5bd91f181c45d..85f2461ab69da8e81d49aeecfaca1b87e280c87a 100644 (file)
@@ -259,8 +259,7 @@ let call_of_string ?callback str =
                ) 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 @@ let response_of_string ?callback str =
                        ) 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
index f0ae723acd99ff0a516433e097b5ff03739d106e..89b7fc4d161e010bb3a044805ba3b16a4cb1c0e6 100644 (file)
@@ -19,4 +19,6 @@ val string_of_call: Rpc.call -> string
 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