diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-12-17 17:52:06 -0800 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-12-17 17:52:06 -0800 |
commit | 18eea99b551e9aea88ddc9c56974d37affee6604 (patch) | |
tree | aafe04d861164d70cfb77fb877249565cfa1466b /indra | |
parent | f13fde664d0de437daf84cebb961f0001aea1303 (diff) |
EXT-3536 Bugfix in lllogin.cpp when reading 'indeterminate' repsonse from login.cgi.
Also fixed up lllogin unit test to match the bugfix.
Reviewed by Brad
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lllogininstance.cpp | 2 | ||||
-rw-r--r-- | indra/viewer_components/login/lllogin.cpp | 10 | ||||
-rw-r--r-- | indra/viewer_components/login/tests/lllogin_test.cpp | 5 |
3 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 7d3da152c1..2dc9f255d7 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -189,7 +189,7 @@ void LLLoginInstance::constructAuthParams(const LLSD& credentials) bool LLLoginInstance::handleLoginEvent(const LLSD& event) { - LL_DEBUGS("Login") << "LoginListener called!: \n" << event << LL_ENDL; + LL_DEBUGS("LLLogin") << "LoginListener called!: \n" << event << LL_ENDL; if(!(event.has("state") && event.has("change") && event.has("progress"))) { diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index 02c13716ed..018f691672 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -222,13 +222,15 @@ void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD credential // Still Downloading -- send progress update. sendProgressEvent("offline", "downloading"); } + + LL_DEBUGS("LLLogin") << "Auth Response: " << mAuthResponse << LL_ENDL; status = mAuthResponse["status"].asString(); // Okay, we've received our final status event for this // request. Unless we got a redirect response, break the retry // loop for the current rewrittenURIs entry. - if (! (status == "Complete" && - mAuthResponse["responses"]["login"].asString() == "indeterminate")) + if (!(status == "Complete" && + mAuthResponse["responses"]["login"].asString() == "indeterminate")) { break; } @@ -237,8 +239,8 @@ void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD credential // to some other URI ("indeterminate" -- why not "redirect"?). // The response should contain another uri to try, with its // own auth method. - request["uri"] = mAuthResponse["next_url"]; - request["method"] = mAuthResponse["next_method"]; + request["uri"] = mAuthResponse["responses"]["next_url"].asString(); + request["method"] = mAuthResponse["responses"]["next_method"].asString(); } // loop back to try the redirected URI // Here we're done with redirects for the current rewrittenURIs diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index 69a8424e87..7159959a4f 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -311,14 +311,15 @@ namespace tut data["error"] = "dummy response"; data["transfer_rate"] = 0; data["responses"]["login"] = "indeterminate"; - data["next_url"] = "login.indeterminate.com"; - data["next_method"] = "test_login_method"; + data["responses"]["next_url"] = "login.indeterminate.com"; + data["responses"]["next_method"] = "test_login_method"; dummyXMLRPC.setResponse(data); dummyXMLRPC.sendReply(); ensure_equals("Fail back to authenticate 2", listener.lastEvent()["change"].asString(), "authenticating"); ensure_equals("Attempt 3", listener.lastEvent()["data"]["attempt"].asInteger(), 3); ensure_equals("URI 3", listener.lastEvent()["data"]["request"]["uri"].asString(), "login.indeterminate.com"); + ensure_equals("Method 3", listener.lastEvent()["data"]["request"]["method"].asString(), "test_login_method"); // Finally let the auth succeed. data.clear(); |