mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
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.
This commit is contained in:
parent
254361cb87
commit
4b19cdeca0
@ -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();
|
||||
|
||||
@ -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(""));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user