From 4c7ff677593ea5a56326ec5a43814291f36bd452 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 1 Apr 2012 20:21:24 +0200 Subject: 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. --- src/net/download.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/net') 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); -- cgit v1.2.3-70-g09d2