From 93d6816740b7ac2d3d28a0f24b9a68ee2d67988e Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 26 Sep 2015 16:50:02 -0400 Subject: [PATCH] Send username with alternate update server request --- src/client/Client.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 95ac31ec0..6805bc5a9 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -137,13 +137,13 @@ 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); @@ -151,7 +151,7 @@ void Client::Initialise(std::string proxyString) //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(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 }