diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-18 01:03:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-19 15:12:19 +0300 |
commit | 786246efd8eb2116e1c36151018feec2b55ef73a (patch) | |
tree | 393cbd84c69bc1d148b92563207572627b48adf5 | |
parent | e87159e68402c64875ec2553df06101ac407f860 (diff) | |
download | mv-786246efd8eb2116e1c36151018feec2b55ef73a.tar.gz mv-786246efd8eb2116e1c36151018feec2b55ef73a.tar.bz2 mv-786246efd8eb2116e1c36151018feec2b55ef73a.tar.xz mv-786246efd8eb2116e1c36151018feec2b55ef73a.zip |
fix code style in download.cpp
-rw-r--r-- | src/net/download.cpp | 7 |
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); |