diff options
| author | Oz Linden <oz@lindenlab.com> | 2017-08-24 10:37:59 -0400 | 
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2017-08-24 10:37:59 -0400 | 
| commit | b3ceeb6d9cf92613a06337b5985e225c612e53d5 (patch) | |
| tree | 3c618ec50a9d1c0c7981347e9a87a66de609f0fc | |
| parent | 08cbed55ef5689fcc5a02dfb3b9afde15487036e (diff) | |
MAINT-7594: add platform name string and address size to login request for crash stats (and add request parameter logging at DEBUG)
| -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 37340a42b6..069b79bb50 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -734,7 +734,7 @@ LLAppViewer::LLAppViewer()  	//  	LLLoginInstance::instance().setUpdaterService(mUpdater.get()); -	LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); +	LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString(), getOSInfo().getOSStringSimple());  }  LLAppViewer::~LLAppViewer() diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b4d0bb6823..bacd88e0e0 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -59,10 +59,16 @@  #include "llupdaterservice.h"  #include "llevents.h"  #include "llappviewer.h" +#include "llsdserialize.h"  #include <boost/scoped_ptr.hpp>  #include <sstream> +// 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() {} @@ -493,10 +499,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() @@ -565,7 +573,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"); @@ -587,8 +594,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) ) @@ -605,11 +611,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; +    } +  	mRequestData.clear();  	mRequestData["method"] = "login_to_simulator";  	mRequestData["params"] = request_params; 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);  -	}  }  | 
