New discovery phase: read the direct download URL and Cookie
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 26 Jul 2018 08:16:28 +0000 (10:16 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:01 +0000 (10:58 +0100)
src/libsync/discovery.cpp
src/libsync/discoveryphase.cpp
src/libsync/discoveryphase.h

index 0e79203351b8436e2d330d5895ec326e25dd2ec3..8e2d183bb92b6d1606ef787968580668aec45f44 100644 (file)
@@ -411,6 +411,8 @@ void ProcessDirectoryJob::processFile(PathTuple path,
         item->_etag = serverEntry.etag;
         item->_previousSize = localEntry.size;
         item->_previousModtime = localEntry.modtime;
+        item->_directDownloadUrl = serverEntry.directDownloadUrl;
+        item->_directDownloadCookies = serverEntry.directDownloadCookies;
         if (!dbEntry.isValid() && !localEntry.isVirtualFile) { // New file on the server
             item->_instruction = CSYNC_INSTRUCTION_NEW;
             item->_direction = SyncFileItem::Down;
index 047fc8ea75028ce12805f183a397c74ff6b8d6f1..e864233139b66373cbdea888f8d07f468e754183 100644 (file)
@@ -252,11 +252,9 @@ static void propertyMapToFileStat(const QMap<QString, QString> &map, RemoteInfo
         } else if (property == "id") {
             result.fileId = value.toUtf8();
         } else if (property == "downloadURL") {
-            qFatal("FIXME: downloadURL and dDC");
-            //file_stat->directDownloadUrl = value.toUtf8();
+            result.directDownloadUrl = value;
         } else if (property == "dDC") {
-            qFatal("FIXME: downloadURL and dDC");
-           // file_stat->directDownloadCookies = value.toUtf8();
+            result.directDownloadCookies = value;
         } else if (property == "permissions") {
             result.remotePerm = RemotePermissions(value);
         } else if (property == "checksums") {
index 94ca1b640228101a5bdbb60833fc903fc6de1be9..82f69266c60c201ea09bdfa282d4f9311c853eb3 100644 (file)
@@ -52,6 +52,9 @@ struct RemoteInfo
     int64_t size = 0;
     bool isDirectory = false;
     bool isValid() const { return !name.isNull(); }
+
+    QString directDownloadUrl;
+    QString directDownloadCookies;
 };
 
 struct LocalInfo