diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-27 22:59:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-27 22:59:20 +0300 |
commit | 2c084aadfebf2860b3aaa42d646dbe80669d4d5e (patch) | |
tree | cc1e93eb4ef1b2c1ee5840e99f9d8fc19fef8f2e /src/net | |
parent | a4ec0e8bb754e9b81c7c8b3013896ae53c933249 (diff) | |
download | plus-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.gz plus-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.bz2 plus-2c084aadfebf2860b3aaa42d646dbe80669d4d5e.tar.xz plus-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')
-rw-r--r-- | src/net/download.cpp | 10 |
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() |