summaryrefslogtreecommitdiff
path: root/src/net/download.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-26 12:52:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-26 15:50:04 +0300
commitbae784c3718b2d28bef80ef57f23c47cc4342c64 (patch)
treeb08ec5545fbe97466386a8fa8e4b51a96b61067b /src/net/download.h
parent61756c26fb29c492b6789b3b6a20f9545c97ec0d (diff)
downloadplus-bae784c3718b2d28bef80ef57f23c47cc4342c64.tar.gz
plus-bae784c3718b2d28bef80ef57f23c47cc4342c64.tar.bz2
plus-bae784c3718b2d28bef80ef57f23c47cc4342c64.tar.xz
plus-bae784c3718b2d28bef80ef57f23c47cc4342c64.zip
add basic file uploading.
For now unused.
Diffstat (limited to 'src/net/download.h')
-rw-r--r--src/net/download.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net/download.h b/src/net/download.h
index d4883f0ca..f5b886053 100644
--- a/src/net/download.h
+++ b/src/net/download.h
@@ -46,6 +46,7 @@ typedef size_t (*WriteFunction)( void *ptr, size_t size, size_t nmemb,
struct SDL_Thread;
typedef void CURL;
+struct curl_httppost;
struct curl_slist;
namespace Net
@@ -55,7 +56,7 @@ class Download final
public:
Download(void *const ptr, const std::string &url,
const DownloadUpdate updateFunction,
- const bool ignoreError);
+ const bool ignoreError, const bool isUpload);
A_DELETE_COPY(Download)
@@ -91,6 +92,12 @@ class Download final
void setIgnoreError(const bool n)
{ mIgnoreError = n; }
+ static size_t writeFunction(void *ptr, size_t size,
+ size_t nmemb, void *stream);
+
+ static void prepareForm(curl_httppost **form,
+ const std::string &fileName);
+
static unsigned long fadler32(FILE *const file) A_WARN_UNUSED;
static void addProxy(CURL *const curl);
@@ -104,6 +111,7 @@ class Download final
static int downloadProgress(void *clientp, double dltotal,
double dlnow, double ultotal,
double ulnow);
+ static std::string mUploadRssponse;
void *mPtr;
std::string mUrl;
struct
@@ -119,8 +127,10 @@ class Download final
SDL_Thread *mThread;
CURL *mCurl;
curl_slist *mHeaders;
+ curl_httppost *mFormPost;
char *mError;
bool mIgnoreError;
+ bool mUpload;
};
} // namespace Net