Permalink
Browse files

Send username with alternate update server request

  • Loading branch information...
jacob1 committed Sep 26, 2015
1 parent cae8c9e commit 93d6816740b7ac2d3d28a0f24b9a68ee2d67988e
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/client/Client.cpp
@@ -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);
@@ -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];
@@ -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
}

0 comments on commit 93d6816

Please sign in to comment.