[Pkg-owncloud-commits] [owncloud-client] 98/159: Discovery: Explicitly check for XML parser errors

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri May 1 13:05:30 UTC 2015


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 9ffacd4ecdb60f5146cc628bf53acf74b9264dd4
Author: Markus Goetz <markus at woboq.com>
Date:   Mon Apr 13 16:04:24 2015 +0200

    Discovery: Explicitly check for XML parser errors
    
    ..instead of relying that our state machine does not do anything in that case.
---
 src/libsync/networkjobs.cpp | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp
index 96edf8d..e8a571a 100644
--- a/src/libsync/networkjobs.cpp
+++ b/src/libsync/networkjobs.cpp
@@ -400,6 +400,9 @@ static QString readContentsAsString(QXmlStreamReader &reader) {
     return result;
 }
 
+// TODO: Instead of doing all in this slot, we should iteratively parse in readyRead(). This
+// would allow us to be more asynchronous in processing while data is coming from the network,
+// not in all in one big blobb at the end.
 bool LsColJob::finished()
 {
     QString contentType = reply()->header(QNetworkRequest::ContentTypeHeader).toString();
@@ -479,13 +482,20 @@ bool LsColJob::finished()
                 }
             }
         }
-        emit directoryListingSubfolders(folders);
-        emit finishedWithoutError();
+
+        if (reader.hasError()) {
+            // XML Parser error? Whatever had been emitted before will come as directoryListingIterated
+            qDebug() << "ERROR" << reader.errorString();
+            emit finishedWithError(reply());
+        } else {
+            emit directoryListingSubfolders(folders);
+            emit finishedWithoutError();
+        }
     } else if (httpCode == 207) {
         // wrong content type
         emit finishedWithError(reply());
     } else {
-        // wrong HTTP code
+        // wrong HTTP code or any other network error
         emit finishedWithError(reply());
     }
     return true;

-- 
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