diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-04-01 20:21:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-04-02 20:24:30 +0200 |
commit | 4c7ff677593ea5a56326ec5a43814291f36bd452 (patch) | |
tree | b36bc37a26ae5d46794d90975c187eac1fde21fb /src/net | |
parent | bc9a2e2135c7f515b29b7ee2e5cefde99c70d6c8 (diff) | |
download | mana-4c7ff677593ea5a56326ec5a43814291f36bd452.tar.gz mana-4c7ff677593ea5a56326ec5a43814291f36bd452.tar.bz2 mana-4c7ff677593ea5a56326ec5a43814291f36bd452.tar.xz mana-4c7ff677593ea5a56326ec5a43814291f36bd452.zip |
Potentially fixed problems with user agent in Windows builds
The Windows releases have not been properly identifying themselves, and
it seems to be due to a compiler issue, as discovered by Stefan Dombrowski
(@cody). He did a similar change but didn't push it anywhere so I've redone
it.
The line that is now split up was very preprocessor-heavy, which may have
been part of the problem, but we'll probably never know what it was
exactly.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/download.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp index 988cc662..bccba7a3 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -220,9 +220,11 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file); } - curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, - strprintf(PACKAGE_EXTENDED_VERSION, - branding.getStringValue("appShort").c_str()).c_str()); + const std::string appShort = branding.getStringValue("appShort"); + const std::string userAgent = + strprintf(PACKAGE_EXTENDED_VERSION, appShort.c_str()); + + curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, userAgent.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_ERRORBUFFER, d->mError); curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0); |