summaryrefslogtreecommitdiff
path: root/src/net/download.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-27 22:59:20 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-27 22:59:20 +0300
commit2c084aadfebf2860b3aaa42d646dbe80669d4d5e (patch)
treecc1e93eb4ef1b2c1ee5840e99f9d8fc19fef8f2e /src/net/download.cpp
parenta4ec0e8bb754e9b81c7c8b3013896ae53c933249 (diff)
downloadmv-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.gz
mv-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.bz2
mv-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.xz
mv-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.zip
add to url with downloaded files also server name with parameter.
example: old resources2.xml new resources2.xml?host=server.themanaworld.org
Diffstat (limited to 'src/net/download.cpp')
-rw-r--r--src/net/download.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 2d8b99cb6..fad0bf6f2 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -22,6 +22,7 @@
#include "net/download.h"
#include "configuration.h"
+#include "client.h"
#include "logger.h"
#include "main.h"
@@ -72,6 +73,15 @@ Download::Download(void *const ptr, const std::string &url,
mOptions.cancel = 0;
mOptions.memoryWrite = 0;
mOptions.checkAdler = true;
+ const std::string serverName = Client::getServerName();
+ if (!serverName.empty())
+ {
+ if (mUrl.find("?") == std::string::npos)
+ mUrl.append("?host=");
+ else
+ mUrl.append("&host=");
+ mUrl.append(serverName);
+ }
}
Download::~Download()