I believe you have a bug when an empty array is sent to a listener using your XMLRPC code. Here's my patch:
--- XmlRpcValue.cpp (revision 1181) +++ XmlRpcValue.cpp (working copy) @@ -33,6 +33,7 @@ static const char ARRAY_TAG[] = "<array>"; static const char DATA_TAG[] = "<data>"; static const char DATA_ETAG[] = "</data>"; + static const char EMPTY_DATA_TAG[]= "<data/>"; static const char ARRAY_ETAG[] = "</array>";
static const char STRUCT_TAG[] = "<struct>"; @@ -459,6 +460,11 @@ // Array bool XmlRpcValue::arrayFromXml(std::string const& valueXml, int* offset) { + if (XmlRpcUtil::nextTagIs(EMPTY_DATA_TAG, valueXml, offset)) { + _type = TypeArray; + _value.asArray = new ValueArray; + return true; + } if ( ! XmlRpcUtil::nextTagIs(DATA_TAG, valueXml, offset)) return false;
Log in to post a comment.
I believe you have a bug when an empty array is sent to a listener using your XMLRPC code. Here's my patch:
--- XmlRpcValue.cpp (revision 1181)
+++ XmlRpcValue.cpp (working copy)
@@ -33,6 +33,7 @@
static const char ARRAY_TAG[] = "<array>";
static const char DATA_TAG[] = "<data>";
static const char DATA_ETAG[] = "</data>";
+ static const char EMPTY_DATA_TAG[]= "<data/>";
static const char ARRAY_ETAG[] = "</array>";
static const char STRUCT_TAG[] = "<struct>";
@@ -459,6 +460,11 @@
// Array
bool XmlRpcValue::arrayFromXml(std::string const& valueXml, int* offset)
{
+ if (XmlRpcUtil::nextTagIs(EMPTY_DATA_TAG, valueXml, offset)) {
+ _type = TypeArray;
+ _value.asArray = new ValueArray;
+ return true;
+ }
if ( ! XmlRpcUtil::nextTagIs(DATA_TAG, valueXml, offset))
return false;