Discovery: Initialize error with EIO
authorMarkus Goetz <markus@woboq.com>
Mon, 13 Apr 2015 13:36:07 +0000 (15:36 +0200)
committerMarkus Goetz <markus@woboq.com>
Mon, 13 Apr 2015 13:36:07 +0000 (15:36 +0200)
src/libsync/discoveryphase.cpp

index 9c36c1286616a8a99ee3b18ef5fdf8c0757274ec..2d3981e214ea13974c6ba149d3fb892875b23643 100644 (file)
@@ -303,7 +303,7 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
     int httpCode = r->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
     QString httpReason = r->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
     QString msg = r->errorString();
-    int errnoCode = 0;
+    int errnoCode = EIO; // Something went wrong
     qDebug() << Q_FUNC_INFO << r->errorString() << httpCode << r->error();
     if (httpCode != 0 && httpCode != 207) {
         errnoCode = get_errno_from_http_errcode(httpCode, httpReason);
@@ -312,6 +312,8 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
     } else if (!contentType.contains("application/xml; charset=utf-8")) {
         msg = QLatin1String("Server error: PROPFIND reply is not XML formatted!");
         errnoCode = ERRNO_WRONG_CONTENT;
+    } else {
+        // Default keep at EIO, see above
     }
 
     emit finishedWithError(errnoCode, msg);