From 1bcbcd407c8e48245fb1e837938bc9e8e8b01091 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 26 Jul 2018 10:16:28 +0200 Subject: [PATCH] New discovery phase: read the direct download URL and Cookie --- src/libsync/discovery.cpp | 2 ++ src/libsync/discoveryphase.cpp | 6 ++---- src/libsync/discoveryphase.h | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 0e7920335..8e2d183bb 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -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; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 047fc8ea7..e86423313 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -252,11 +252,9 @@ static void propertyMapToFileStat(const QMap &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") { diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index 94ca1b640..82f69266c 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -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 -- 2.39.5