summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 01:03:44 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:19 +0300
commit786246efd8eb2116e1c36151018feec2b55ef73a (patch)
tree393cbd84c69bc1d148b92563207572627b48adf5 /src/net/download.cpp
parente87159e68402c64875ec2553df06101ac407f860 (diff)
downloadmanaplus-786246efd8eb2116e1c36151018feec2b55ef73a.tar.gz
manaplus-786246efd8eb2116e1c36151018feec2b55ef73a.tar.bz2
manaplus-786246efd8eb2116e1c36151018feec2b55ef73a.tar.xz
manaplus-786246efd8eb2116e1c36151018feec2b55ef73a.zip
fix code style in download.cpp
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r--src/net/download.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index fad1ec0b4..3f26aabe7 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -173,7 +173,7 @@ bool Download::start()
{
logger->log("Starting download: %s", mUrl.c_str());
- mThread = SDL::createThread(downloadThread, "download", this);
+ mThread = SDL::createThread(&downloadThread, "download", this);
if (!mThread)
{
logger->log1(DOWNLOAD_ERROR_MESSAGE_THREAD);
@@ -266,7 +266,8 @@ int Download::downloadThread(void *ptr)
else
{
file = fopen(outFilename.c_str(), "w+b");
- curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file);
+ if (file)
+ curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file);
}
curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT,
@@ -276,7 +277,7 @@ int Download::downloadThread(void *ptr)
curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str());
curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSFUNCTION,
- downloadProgress);
+ &downloadProgress);
curl_easy_setopt(d->mCurl, CURLOPT_PROGRESSDATA, ptr);
curl_easy_setopt(d->mCurl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(d->mCurl, CURLOPT_CONNECTTIMEOUT, 30);