Send username with alternate update server request

This commit is contained in:
jacob1 2015-09-26 16:50:02 -04:00
parent cae8c9e095
commit 93d6816740

View File

@ -137,13 +137,13 @@ Client::Client():
void Client::Initialise(std::string proxyString) void Client::Initialise(std::string proxyString)
{ {
if(GetPrefBool("version.update", false)==true) if (GetPrefBool("version.update", false)==true)
{ {
SetPref("version.update", false); SetPref("version.update", false);
update_finish(); update_finish();
} }
if(proxyString.length()) if (proxyString.length())
http_init((char*)proxyString.c_str()); http_init((char*)proxyString.c_str());
else else
http_init(NULL); http_init(NULL);
@ -151,7 +151,7 @@ void Client::Initialise(std::string proxyString)
//Read stamps library //Read stamps library
std::ifstream stampsLib; std::ifstream stampsLib;
stampsLib.open(STAMPS_DIR PATH_SEP "stamps.def", std::ios::binary); stampsLib.open(STAMPS_DIR PATH_SEP "stamps.def", std::ios::binary);
while(!stampsLib.eof()) while (!stampsLib.eof())
{ {
char data[11]; char data[11];
memset(data, 0, 11); memset(data, 0, 11);
@ -165,7 +165,7 @@ void Client::Initialise(std::string proxyString)
//Begin version check //Begin version check
versionCheckRequest = http_async_req_start(NULL, "http://" SERVER "/Startup.json", NULL, 0, 0); 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); std::string idTempString = format::NumberToString<int>(authUser.ID);
char *id = new char[idTempString.length() + 1]; char *id = new char[idTempString.length() + 1];
@ -181,6 +181,10 @@ void Client::Initialise(std::string proxyString)
// use an alternate update server // use an alternate update server
alternateVersionCheckRequest = http_async_req_start(NULL, "http://" UPDATESERVER "/Startup.json", NULL, 0, 0); alternateVersionCheckRequest = http_async_req_start(NULL, "http://" UPDATESERVER "/Startup.json", NULL, 0, 0);
usingAltUpdateServer = true; usingAltUpdateServer = true;
if (authUser.ID)
{
http_auth_headers(alternateVersionCheckRequest, authUser.Username.c_str(), NULL, NULL);
}
#endif #endif
} }