diff options
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 29 | ||||
-rw-r--r-- | indra/newview/lllogininstance.h | 3 | ||||
-rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 107 |
4 files changed, 29 insertions, 112 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 51d7ad1138..98d622acf9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -733,7 +733,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString(), LLOSInfo::instance().getOSStringSimple()); } LLAppViewer::~LLAppViewer() diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 40e98947a3..77eadef716 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -59,12 +59,18 @@ #include "llupdaterservice.h" #include "llevents.h" #include "llappviewer.h" +#include "llsdserialize.h" #include <boost/scoped_ptr.hpp> #include <sstream> const S32 LOGIN_MAX_RETRIES = 3; +// this can be removed once it is defined by the build for all forks +#ifndef ADDRESS_SIZE +# define ADDRESS_SIZE 32 +#endif + class LLLoginInstance::Disposable { public: virtual ~Disposable() {} @@ -495,10 +501,12 @@ LLLoginInstance::LLLoginInstance() : } void LLLoginInstance::setPlatformInfo(const std::string platform, - const std::string platform_version) + const std::string platform_version, + const std::string platform_name) { mPlatform = platform; mPlatformVersion = platform_version; + mPlatformVersionName = platform_name; } LLLoginInstance::~LLLoginInstance() @@ -567,7 +575,6 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia requested_options.append("event_notifications"); requested_options.append("classified_categories"); requested_options.append("adult_compliant"); - //requested_options.append("inventory-targets"); requested_options.append("buddy-list"); requested_options.append("newuser-config"); requested_options.append("ui-config"); @@ -589,8 +596,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia requested_options.append("god-connect"); } - // (re)initialize the request params with creds. - LLSD request_params = user_credential->getLoginParams(); + LLSD request_params; unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; if ( ! llHashedUniqueID(hashed_unique_id_string) ) @@ -607,11 +613,26 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia request_params["version"] = LLVersionInfo::getVersion(); request_params["channel"] = LLVersionInfo::getChannel(); request_params["platform"] = mPlatform; + request_params["address_size"] = ADDRESS_SIZE; request_params["platform_version"] = mPlatformVersion; + request_params["platform_string"] = mPlatformVersionName; request_params["id0"] = mSerialNumber; request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // log request_params _before_ adding the credentials + LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer<LLSDNotationFormatter>(request_params) << LL_ENDL; + + // Copy the credentials into the request after logging the rest + LLSD credentials(user_credential->getLoginParams()); + for (LLSD::map_const_iterator it = credentials.beginMap(); + it != credentials.endMap(); + it++ + ) + { + request_params[it->first] = it->second; + } + // Specify desired timeout/retry options LLSD http_params; http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 282ddc1cea..1adea67189 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -67,7 +67,7 @@ public: void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } - void setPlatformInfo(const std::string platform, const std::string platform_version); + void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } @@ -105,6 +105,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; + std::string mPlatformVersionName; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; LLUpdaterService * mUpdaterService; diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b603157ca7..978678a09c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -362,7 +362,7 @@ namespace tut accountCredential->setCredentialData(identifier, authenticator); logininstance->setNotificationsInterface(¬ifications); - logininstance->setPlatformInfo("win", "1.3.5"); + logininstance->setPlatformInfo("win", "1.3.5", "Windows Bogus Version 100.6.6.6"); } LLLoginInstance* logininstance; @@ -478,109 +478,4 @@ namespace tut ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false); } - template<> template<> - void lllogininstance_object::test<3>() - { - set_test_name("Test Mandatory Update User Accepts"); - - // Part 1 - Mandatory Update, with User accepts response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<4>() - { - set_test_name("Test Mandatory Update User Decline"); - - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<6>() - { - set_test_name("Test Optional Update User Accept"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<7>() - { - set_test_name("Test Optional Update User Denies"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - // User skips, should be reconnecting. - ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI); - ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true); - } } |