diff options
author | aunsane <aunsane@gmail.com> | 2017-05-09 23:04:10 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-05-09 23:04:31 +0300 |
commit | ae52dee4a7b2e108dc260d52ce0e0bde78474ac9 (patch) | |
tree | 4f4686a83ff901e136765f321a8550085e03ef5c /plugins/CloudFile/src/Services/dropbox_service.cpp | |
parent | af8a9e244150d0fe2e584a23ed9a5432c58f8e56 (diff) |
CloudFile: fix upload
Diffstat (limited to 'plugins/CloudFile/src/Services/dropbox_service.cpp')
-rw-r--r-- | plugins/CloudFile/src/Services/dropbox_service.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index ef70949d55..520cdf1378 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -136,10 +136,10 @@ void CDropboxService::UploadFileChunk(const char *chunk, size_t chunkSize, const DropboxAPI::UploadFileChunkRequest request(token, sessionId, offset, chunk, chunkSize); NLHR_PTR response(request.Send(hConnection)); - GetJsonResponse(response); + HandleHttpError(response); } -char* CDropboxService::CommitUploadSession(const char *data, size_t size, const char *sessionId, size_t offset, char *path) +void CDropboxService::CommitUploadSession(const char *data, size_t size, const char *sessionId, size_t offset, char *path) { ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret")); DropboxAPI::CommitUploadSessionRequest request(token, sessionId, offset, path, data, size); @@ -148,8 +148,6 @@ char* CDropboxService::CommitUploadSession(const char *data, size_t size, const JSONNode root = GetJsonResponse(response); JSONNode node = root.at("path_lower"); mir_strcpy(path, node.as_string().c_str()); - - return path; } void CDropboxService::CreateFolder(const char *path) @@ -243,8 +241,7 @@ UINT CDropboxService::Upload(FileTransferParam *ftp) size_t offset = size; double chunkCount = ceil(double(fileSize) / chunkSize) - 2; - while (chunkCount--) - { + while (chunkCount > 0) { ftp->CheckCurrentFile(); size = ftp->ReadCurrentFile(data, chunkSize); |