summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-03 20:16:10 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-03 20:16:10 +0300
commit25bed1bb7f7dbfa3caa0f239c63dbabd3b0bd50d (patch)
tree8bfccdf8798a10538852a7c1c2602222a7a21884 /src/net
parent97a95e67ca713a306ae76f2d9bb804543f3c991d (diff)
downloadmanaplus-25bed1bb7f7dbfa3caa0f239c63dbabd3b0bd50d.tar.gz
manaplus-25bed1bb7f7dbfa3caa0f239c63dbabd3b0bd50d.tar.bz2
manaplus-25bed1bb7f7dbfa3caa0f239c63dbabd3b0bd50d.tar.xz
manaplus-25bed1bb7f7dbfa3caa0f239c63dbabd3b0bd50d.zip
Fix downloading updates from mirrors.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 1c555f5ef..26a3cfe58 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -276,6 +276,7 @@ int Download::downloadThread(void *ptr)
d->mUrl = d->mUrlQueue.front();
d->mUrlQueue.pop();
+ logger->log_r("selected url: %s", d->mUrl.c_str());
while (attempts < 3 && !complete && !d->mOptions.cancel)
{
d->mUpdateFunction(d->mPtr, DOWNLOAD_STATUS_STARTING, 0, 0);
@@ -347,14 +348,17 @@ int Download::downloadThread(void *ptr)
break;
case CURLE_COULDNT_CONNECT:
default:
- {
- if (d->mError)
- {
- logger->log_r("curl error %d: %s host: %s",
- res, d->mError, d->mUrl.c_str());
- }
break;
+ }
+
+ if (res)
+ {
+ if (d->mError)
+ {
+ logger->log_r("curl error %d: %s host: %s",
+ res, d->mError, d->mUrl.c_str());
}
+ break;
}
if (d->mOptions.cancel)
@@ -462,8 +466,6 @@ int Download::downloadThread(void *ptr)
if ((complete && attempts < 3) || d->mOptions.cancel)
break;
-
- logger->log_r("switch to next mirror: %s", d->mFileName.c_str());
}
d->mThread = nullptr;