From 11f30bc28d79a9c325f98292b8a3a716f63e8869 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sun, 16 Dec 2012 23:17:10 +0100 Subject: [PATCH 1/3] Removed gFullName which isn't used anywhere --- indra/newview/llpanellogin.cpp | 4 ---- indra/newview/llpanellogin.h | 8 -------- indra/newview/llstartup.cpp | 24 ------------------------ 3 files changed, 36 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 019ddd668..134363bce 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -162,10 +162,6 @@ public: LLLoginRefreshHandler gLoginRefreshHandler; -// -std::string gFullName; -// - // helper class that trys to download a URL from a web site and calls a method // on parent class indicating if the web server is working or not class LLIamHereLogin : public LLHTTPClient::ResponderHeadersOnly diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 53eb9b52d..1812b6fc7 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -41,10 +41,6 @@ class LLUIImage; class LLComboBox; -// -extern std::string gFullName; -// - class LLPanelLogin: public LLPanel, public LLViewerMediaObserver @@ -165,8 +161,4 @@ private: std::string load_password_from_disk(void); void save_password_to_disk(const char* hashed_password); -// -extern std::string gFullName; -// - #endif diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6d1e2d92c..168685799 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -757,9 +757,6 @@ bool idle_startup() // We have at least some login information on a SLURL firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // web_login_key = gLoginHandler.getWebLoginKey(); // Show the login screen if we don't have everything @@ -771,9 +768,6 @@ bool idle_startup() LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); firstname = cmd_line_login[0].asString(); lastname = cmd_line_login[1].asString(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // LLMD5 pass((unsigned char*)cmd_line_login[2].asString().c_str()); char md5pass[33]; /* Flawfinder: ignore */ @@ -791,9 +785,6 @@ bool idle_startup() { firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // password = LLStartUp::loadPasswordFromDisk(); gSavedSettings.setBOOL("RememberPassword", TRUE); @@ -809,9 +800,6 @@ bool idle_startup() // a valid grid is selected firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // password = LLStartUp::loadPasswordFromDisk(); show_connect_box = true; } @@ -895,9 +883,6 @@ bool idle_startup() else { LLPanelLogin::setFields(firstname, lastname, password); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // LLPanelLogin::giveFocus(); } display_startup(); @@ -969,9 +954,6 @@ bool idle_startup() { firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // web_login_key = gLoginHandler.getWebLoginKey(); } @@ -990,9 +972,6 @@ bool idle_startup() { gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // if (!gSavedSettings.controlExists("RememberLogin")) gSavedSettings.declareBOOL("RememberLogin", false, "Remember login", false); gSavedSettings.setBOOL("RememberLogin", LLPanelLogin::getRememberLogin()); @@ -4099,9 +4078,6 @@ bool process_login_success_response(std::string& password) if(!text.empty()) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // if (gSavedSettings.getBOOL("RememberPassword")) { From aab764a6e5657a3b1cf871b6469c8d31629faa5b Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sun, 16 Dec 2012 23:39:58 +0100 Subject: [PATCH 2/3] Don't crash when user forgets last name on non-SL grids. --- indra/newview/llstartup.cpp | 9 +++++++++ .../skins/default/xui/en-us/notifications.xml | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 168685799..3d7f1869f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -978,6 +978,15 @@ bool idle_startup() LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; gDebugInfo["LoginName"] = firstname + " " + lastname; } + else + { + // User tried to login on a non-SecondLife grid with an empty lastname. + LLSD subs; + subs["GRIDNAME"] = gHippoGridManager->getConnectedGrid()->getGridName(); + LLNotificationsUtil::add(firstname.empty() ? "EmptyFirstNameMessage" : "EmptyLastNameMessage", subs); + LLStartUp::setStartupState(STATE_LOGIN_SHOW); + return FALSE; + } LLScriptEdCore::parseFunctions("lsl_functions_sl.xml"); //Singu Note: This parsing function essentially replaces the entirety of the lscript_library library diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index acb78b1f4..1161aaecc 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -264,6 +264,22 @@ An error occurred while updating [APP_NAME]. Please download the latest version yestext="Ok"/> + +[GRIDNAME] requires a non-empty first name to login. +Please try again. + + + +[GRIDNAME] requires a non-empty last name to login. +Please try again. + + Date: Fri, 28 Dec 2012 16:43:34 +0100 Subject: [PATCH 3/3] Avoid crashing at exit by joining the curl thread. --- indra/llmessage/aicurlthread.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index b8c700997..209704cdf 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -838,6 +838,9 @@ class AICurlThread : public LLThread // MAIN-THREAD void stop_thread(void) { mRunning = false; wakeup_thread(); } + // MAIN-THREAD + apr_status_t join_thread(void); + protected: virtual void run(void); void wakeup(AICurlMultiHandle_wat const& multi_handle_w); @@ -1110,6 +1113,17 @@ void AICurlThread::wakeup_thread(void) #endif } +apr_status_t AICurlThread::join_thread(void) +{ + apr_status_t retval = APR_SUCCESS; + if (sInstance) + { + apr_thread_join(&retval, sInstance->mAPRThreadp); + delete sInstance; + } + return retval; +} + void AICurlThread::wakeup(AICurlMultiHandle_wat const& multi_handle_w) { DoutEntering(dc::curl, "AICurlThread::wakeup"); @@ -2148,12 +2162,22 @@ void stopCurlThread(void) if (AICurlThread::sInstance) { AICurlThread::sInstance->stop_thread(); - int count = 101; + int count = 401; while(--count && !AICurlThread::sInstance->isStopped()) { ms_sleep(10); } - Dout(dc::curl, "Curl thread" << (curlThreadIsRunning() ? " not" : "") << " stopped after " << ((100 - count) * 10) << "ms."); + if (AICurlThread::sInstance->isStopped()) + { + // isStopped() returns true somewhere at the end of run(), + // but that doesn't mean the thread really stopped: it still + // needs to destroy it's static variables. + // If we don't join here, then there is a chance that the + // curl thread will crash when using globals that we (the + // main thread) will have destroyed before it REALLY finished. + AICurlThread::sInstance->join_thread(); // Wait till it is REALLY done. + } + llinfos << "Curl thread" << (curlThreadIsRunning() ? " not" : "") << " stopped after " << ((400 - count) * 10) << "ms." << llendl; } }