aboutsummaryrefslogtreecommitdiff
path: root/source/xmlrpc.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 15:07:35 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 15:07:35 +0000
commit05e418edc732b63048db65a715238c602f8e8524 (patch)
tree591377dc311b72456b218a88e3820df11610fef3 /source/xmlrpc.cpp
parent01cca28befc8cfc762305b80b606d1b707367eb8 (diff)
downloadqxmpp-05e418edc732b63048db65a715238c602f8e8524.tar.gz
tighten XML RPC parsing
Diffstat (limited to 'source/xmlrpc.cpp')
-rw-r--r--source/xmlrpc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/xmlrpc.cpp b/source/xmlrpc.cpp
index 3db63f0d..55008731 100644
--- a/source/xmlrpc.cpp
+++ b/source/xmlrpc.cpp
@@ -181,14 +181,14 @@ bool XMLRPC::RequestMessage::parse(const QDomElement &element)
const QDomElement methodParams = element.firstChildElement("params");
if( !methodParams.isNull() )
{
- QDomNode param = methodParams.firstChild();
+ QDomNode param = methodParams.firstChildElement("param");
while (!param.isNull())
{
QVariant arg = demarshall(param.firstChild().toElement(), errors);
if (!errors.isEmpty())
return false;
m_args << arg;
- param = param.nextSibling();
+ param = param.nextSiblingElement("param");
}
}
return true;
@@ -238,20 +238,20 @@ bool XMLRPC::ResponseMessage::parse(const QDomElement &element)
const QDomElement contents = element.firstChild().toElement();
if( contents.tagName().toLower() == "params")
{
- QDomNode param = contents.firstChild();
+ QDomNode param = contents.firstChildElement("param");
while (!param.isNull())
{
- const QVariant value = demarshall(param.firstChild().toElement(), errors);
+ const QVariant value = demarshall(param.firstChildElement(), errors);
if (!errors.isEmpty())
return false;
m_values << value;
- param = param.nextSibling();
+ param = param.nextSiblingElement("param");
}
return true;
}
else if( contents.tagName().toLower() == "fault")
{
- const QDomElement errElement = contents.firstChild().toElement();
+ const QDomElement errElement = contents.firstChildElement();
const QVariant error = demarshall(errElement, errors);
qWarning() << QString("XMLRPC Fault %1: %2")