From d4e64ad19a3bc6d384c973715497fc6283750e3a Mon Sep 17 00:00:00 2001 From: aunsane Date: Mon, 12 Mar 2018 23:44:52 +0300 Subject: Autobackup to CloudFile doesn't work (fixed #1176) --- plugins/CloudFile/src/Services/dropbox_service.cpp | 2 +- plugins/CloudFile/src/Services/google_service.cpp | 2 +- plugins/CloudFile/src/Services/microsoft_service.cpp | 4 +--- plugins/CloudFile/src/Services/yandex_service.cpp | 2 +- plugins/CloudFile/src/http_request.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index dfbdc0f799..4e308e1612 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -262,7 +262,7 @@ UINT CDropboxService::Upload(FileTransferParam *ftp) size_t offset = size; double chunkCount = ceil(double(fileSize) / chunkSize) - 2; - while (chunkCount > 0) { + for (size_t i = 0; i < chunkCount; i++) { ftp->CheckCurrentFile(); size = ftp->ReadCurrentFile(chunk, chunkSize); diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index dde5fc4b39..bbdf3255d7 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -257,7 +257,7 @@ UINT CGDriveService::Upload(FileTransferParam *ftp) uint64_t offset = 0; double chunkCount = ceil(double(fileSize) / chunkSize); - while (chunkCount > 0) { + for (size_t i = 0; i < chunkCount; i++) { ftp->CheckCurrentFile(); size_t size = ftp->ReadCurrentFile(chunk, chunkSize); auto fileId = UploadFileChunk(uploadUri, chunk, size, offset, fileSize); diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp index 4fe9066c22..94892d7a41 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.cpp +++ b/plugins/CloudFile/src/Services/microsoft_service.cpp @@ -246,12 +246,10 @@ UINT COneDriveService::Upload(FileTransferParam *ftp) uint64_t offset = 0; double chunkCount = ceil(double(fileSize) / chunkSize); - while (chunkCount > 0) { + for (size_t i = 0; i < chunkCount; i++) { ftp->CheckCurrentFile(); size_t size = ftp->ReadCurrentFile(chunk, chunkSize); - fileId = UploadFileChunk(uploadUri, chunk, size, offset, fileSize); - offset += size; ftp->Progress(size); } diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index 662659f8c6..6e471d18f9 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -252,7 +252,7 @@ UINT CYandexService::Upload(FileTransferParam *ftp) else { uint64_t offset = 0; double chunkCount = ceil(double(fileSize) / chunkSize); - while (chunkCount > 0) { + for (size_t i = 0; i < chunkCount; i++) { ftp->CheckCurrentFile(); size_t size = ftp->ReadCurrentFile(chunk, chunkSize); UploadFileChunk(uploadUri, chunk, size, offset, fileSize); diff --git a/plugins/CloudFile/src/http_request.h b/plugins/CloudFile/src/http_request.h index aed8167b98..d49c225013 100644 --- a/plugins/CloudFile/src/http_request.h +++ b/plugins/CloudFile/src/http_request.h @@ -26,7 +26,7 @@ private: { cbSize = sizeof(NETLIBHTTPREQUEST); requestType = type; - flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT; + flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMP; szUrl = NULL; headers = NULL; headersCount = 0; -- cgit v1.2.3