[Pkg-owncloud-commits] [owncloud-client] 163/470: Propfind: Treat broken XML response as failure #4575
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:24:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 4b19cdeca035df36baffdc9cfb61052bf2f64543
Author: Christian Kamm <mail at ckamm.de>
Date: Thu Mar 17 10:29:35 2016 +0100
Propfind: Treat broken XML response as failure #4575
Soldiering on with a broken or incomplete response could lead to
incorrect sync behavior.
Since discovery uses LsCol jobs which already handle errors
correctly, this should not have a significant impact.
---
src/libsync/abstractnetworkjob.cpp | 2 +-
src/libsync/networkjobs.cpp | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp
index 60ac96f..e1a654b 100644
--- a/src/libsync/abstractnetworkjob.cpp
+++ b/src/libsync/abstractnetworkjob.cpp
@@ -265,7 +265,7 @@ QString extractErrorMessage(const QByteArray& errorResponse)
}
QString exception;
- while (!reader.atEnd() && reader.error() == QXmlStreamReader::NoError) {
+ while (!reader.atEnd() && !reader.hasError()) {
reader.readNextStartElement();
if (reader.name() == QLatin1String("message")) {
QString message = reader.readElementText();
diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp
index 58550b2..09472be 100644
--- a/src/libsync/networkjobs.cpp
+++ b/src/libsync/networkjobs.cpp
@@ -558,7 +558,12 @@ bool PropfindJob::finished()
}
}
}
- emit result(items);
+ if (reader.hasError()) {
+ qDebug() << "PROPFIND request XML parser error: " << reader.errorString();
+ emit finishedWithError(reply());
+ } else {
+ emit result(items);
+ }
} else {
qDebug() << "PROPFIND request *not* successful, http result code is" << http_result_code
<< (http_result_code == 302 ? reply()->header(QNetworkRequest::LocationHeader).toString() : QLatin1String(""));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list