Skip to content

Commit

Permalink
Send username with alternate update server request
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Sep 26, 2015
1 parent cae8c9e commit 93d6816
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/client/Client.cpp
Expand Up @@ -137,21 +137,21 @@ Client::Client():

void Client::Initialise(std::string proxyString)
{
if(GetPrefBool("version.update", false)==true)
if (GetPrefBool("version.update", false)==true)
{
SetPref("version.update", false);
update_finish();
}

if(proxyString.length())
if (proxyString.length())
http_init((char*)proxyString.c_str());
else
http_init(NULL);

//Read stamps library
std::ifstream stampsLib;
stampsLib.open(STAMPS_DIR PATH_SEP "stamps.def", std::ios::binary);
while(!stampsLib.eof())
while (!stampsLib.eof())
{
char data[11];
memset(data, 0, 11);
Expand All @@ -165,7 +165,7 @@ void Client::Initialise(std::string proxyString)
//Begin version check
versionCheckRequest = http_async_req_start(NULL, "http://" SERVER "/Startup.json", NULL, 0, 0);

if(authUser.ID)
if (authUser.ID)
{
std::string idTempString = format::NumberToString<int>(authUser.ID);
char *id = new char[idTempString.length() + 1];
Expand All @@ -181,6 +181,10 @@ void Client::Initialise(std::string proxyString)
// use an alternate update server
alternateVersionCheckRequest = http_async_req_start(NULL, "http://" UPDATESERVER "/Startup.json", NULL, 0, 0);
usingAltUpdateServer = true;
if (authUser.ID)
{
http_auth_headers(alternateVersionCheckRequest, authUser.Username.c_str(), NULL, NULL);
}
#endif
}

Expand Down

0 comments on commit 93d6816

Please sign in to comment.