From 2e5c904f370d48a8e780ce64db2633d54ec0f5cd Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 23 May 2015 20:51:11 +0000 Subject: Dropbox: - fixed crash on file upload - added upload icon (thx dracosha) - resource fix - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@13797 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/api/upload.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'plugins/Dropbox/src/api') diff --git a/plugins/Dropbox/src/api/upload.h b/plugins/Dropbox/src/api/upload.h index a871940e20..4bc9da9043 100644 --- a/plugins/Dropbox/src/api/upload.h +++ b/plugins/Dropbox/src/api/upload.h @@ -4,34 +4,31 @@ class UploadFileRequest : public HttpRequest { public: - UploadFileRequest(const char *token, const char *fileName, const char *data, int length, const char *root = "auto") : + UploadFileRequest(const char *token, const char *fileName, const char *data, size_t size, const char *root = "auto") : HttpRequest(REQUEST_PUT, FORMAT, DROPBOX_APICONTENT_URL "/files_put/%s/%s", root, fileName) { AddBearerAuthHeader(token); - pData = (char*)data; - dataLength = length; + SetData(data, size); } }; class UploadFileChunkRequest : public HttpRequest { public: - UploadFileChunkRequest(const char *token, const char *data, int length) : + UploadFileChunkRequest(const char *token, const char *data, size_t size) : HttpRequest(REQUEST_PUT, DROPBOX_APICONTENT_URL "/chunked_upload") { AddBearerAuthHeader(token); AddHeader("Content-Type", "application/octet-stream"); - pData = (char*)data; - dataLength = length; + SetData(data, size); } - UploadFileChunkRequest(const char *token, const char *uploadId, size_t offset, const char *data, int length) : + UploadFileChunkRequest(const char *token, const char *uploadId, size_t offset, const char *data, size_t size) : HttpRequest(REQUEST_PUT, FORMAT, DROPBOX_APICONTENT_URL "/chunked_upload?upload_id=%s&offset=%i", uploadId, offset) { AddBearerAuthHeader(token); AddHeader("Content-Type", "application/octet-stream"); - pData = (char*)data; - dataLength = length; + SetData(data, size); } UploadFileChunkRequest(const char *token, const char *uploadId, const char *path, const char *root = "auto") : -- cgit v1.2.3