Skip to content

Commit

Permalink
Potentially fixed problems with user agent in Windows builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bjorn committed Apr 2, 2012
1 parent bc9a2e2 commit 4c7ff67
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/net/download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4c7ff67

Please sign in to comment.