New discovery phase: read the direct download URL and Cookie

This commit is contained in:
Olivier Goffart 2018-07-26 10:16:28 +02:00 committed by Kevin Ottens
parent ca32eb1cf7
commit 1bcbcd407c
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
3 changed files with 7 additions and 4 deletions

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

View 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") {

View 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