summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/api
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-23 20:51:11 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-23 20:51:11 +0000
commit2e5c904f370d48a8e780ce64db2633d54ec0f5cd (patch)
tree9d18c3dd5cb067588c6a8e345f96230e323703c8 /plugins/Dropbox/src/api
parent8e146597bbd27b72a42a3a197c1db17153e2e0b3 (diff)
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
Diffstat (limited to 'plugins/Dropbox/src/api')
-rw-r--r--plugins/Dropbox/src/api/upload.h15
1 files changed, 6 insertions, 9 deletions
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") :