From acfbb41f4ddb59cd1fe0509949b7b1cf05ac4c9a Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 20 Aug 2020 19:49:23 +0300 Subject: [PATCH 01/20] SL-13813 The current line is not selected after triple-clicking text in notecard on the macOS --- indra/llwindow/llopenglview-objc.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 5b9dce02c4..d2c5b11c3d 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -359,10 +359,10 @@ attributedStringInfo getSegments(NSAttributedString *str) callRightMouseDown(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = true; } else { - if ([theEvent clickCount] >= 2) + if ([theEvent clickCount] == 2) { callDoubleClick(mMousePos, [theEvent modifierFlags]); - } else if ([theEvent clickCount] == 1) { + } else if ([theEvent clickCount] >= 1) { callLeftMouseDown(mMousePos, [theEvent modifierFlags]); } } From e4350fb9ef1a44416f0ef7873595db41b05dafc4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 19 Aug 2020 21:27:58 +0300 Subject: [PATCH 02/20] SL-13811 Crash on coroprocedure Coroprosedure should stop on 'stop' exception --- indra/llmessage/llcoproceduremanager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 3f55bda1e3..969cd162fb 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -415,6 +415,14 @@ void LLCoprocedurePool::coprocedureInvokerCoro( { coproc->mProc(httpAdapter, coproc->mId); } + catch (const LLCoros::Stop &) + { + LL_INFOS("CoProcMgr") << "Viewer is shutting Down. Stopping coprocedure('" << coproc->mName + << "', id=" << coproc->mId.asString() + << ") in pool '" << mPoolName << "'" << LL_ENDL; + mActiveCoprocs.erase(itActive); + throw; // let toplevel handle this as LLContinueError + } catch (...) { LOG_UNHANDLED_EXCEPTION(STRINGIZE("Coprocedure('" << coproc->mName From f72b5b8fd829a266316de743432545430810affb Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 21 Aug 2020 00:21:46 +0300 Subject: [PATCH 03/20] SL-13828 Fixed the Media URL editing on the media prim --- indra/newview/llpanelprimmediacontrols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 67cd23d2ee..2bd78f40ba 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -258,7 +258,7 @@ void LLPanelPrimMediaControls::focusOnTarget() LLViewerMediaImpl* media_impl = getTargetMediaImpl(); if(media_impl) { - if (!media_impl->hasFocus() || isZoomDistExceeding()) + if (!media_impl->hasFocus()) { // The current target doesn't have media focus -- focus on it. LLViewerObject* objectp = getTargetObject(); From b856745048212175eac19536e40cf563b874f6b4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 21 Aug 2020 20:14:26 +0300 Subject: [PATCH 04/20] SL-13835 SSL verification should not crash on invalid certificate --- indra/newview/llappcorehttp.cpp | 22 +++++++++---------- indra/newview/llsecapi.h | 10 +++++++++ indra/newview/llsechandler_basic.cpp | 6 +++-- indra/newview/llstartup.cpp | 21 ++++++++++++++++-- .../newview/skins/default/xui/en/strings.xml | 1 + 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index afa4414968..134a34137b 100644 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -522,20 +522,20 @@ void LLAppCoreHttp::refreshSettings(bool initial) LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, const LLCore::HttpHandler::ptr_t &handler, void *appdata) { - X509_STORE_CTX *ctx = static_cast(appdata); - LLCore::HttpStatus result; - LLPointer store = gSecAPIHandler->getCertificateStore(""); - LLPointer chain = gSecAPIHandler->getCertificateChain(ctx); - LLSD validation_params = LLSD::emptyMap(); - LLURI uri(url); + LLCore::HttpStatus result; + try + { + X509_STORE_CTX *ctx = static_cast(appdata); + LLPointer store = gSecAPIHandler->getCertificateStore(""); + LLPointer chain = gSecAPIHandler->getCertificateChain(ctx); + LLSD validation_params = LLSD::emptyMap(); + LLURI uri(url); - validation_params[CERT_HOSTNAME] = uri.hostName(); + validation_params[CERT_HOSTNAME] = uri.hostName(); - // *TODO: In the case of an exception while validating the cert, we need a way - // to pass the offending(?) cert back out. *Rider* + // *TODO: In the case of an exception while validating the cert, we need a way + // to pass the offending(?) cert back out. *Rider* - try - { // don't validate hostname. Let libcurl do it instead. That way, it'll handle redirects store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params); } diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 69b6b32923..ae87cac53c 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -345,6 +345,16 @@ protected: LLSD mCertData; }; +class LLAllocationCertException : public LLCertException +{ +public: + LLAllocationCertException(const LLSD& cert_data) : LLCertException(cert_data, "CertAllocationFailure") + { + } + virtual ~LLAllocationCertException() throw() {} +protected: +}; + class LLInvalidCertificate : public LLCertException { public: diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 8e52480644..8a922aee4f 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -78,14 +78,16 @@ LLBasicCertificate::LLBasicCertificate(const std::string& pem_cert, BIO * pem_bio = BIO_new_mem_buf((void*)pem_cert.c_str(), pem_cert.length()); if(pem_bio == NULL) { - LL_ERRS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL; + LL_WARNS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL; + LLTHROW(LLAllocationCertException(LLSD::emptyMap())); } mCert = NULL; PEM_read_bio_X509(pem_bio, &mCert, 0, NULL); BIO_free(pem_bio); if (!mCert) { - LL_ERRS("SECAPI") << "Could not decode certificate to x509." << LL_ENDL; + LL_WARNS("SECAPI") << "Could not decode certificate to x509." << LL_ENDL; + LLTHROW(LLInvalidCertificate(LLSD::emptyMap())); } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1257add71d..b130fd281c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1106,7 +1106,7 @@ bool idle_startup() // If optional was skipped this case shouldn't // be reached. - LL_INFOS() << "Forcing a quit due to update." << LL_ENDL; + LL_INFOS("LLStartup") << "Forcing a quit due to update." << LL_ENDL; LLLoginInstance::getInstance()->disconnect(); LLAppViewer::instance()->forceQuit(); } @@ -1127,7 +1127,24 @@ bool idle_startup() { // This was a certificate error, so grab the certificate // and throw up the appropriate dialog. - LLPointer certificate = gSecAPIHandler->getCertificate(response["certificate"]); + LLPointer certificate; + try + { + certificate = gSecAPIHandler->getCertificate(response["certificate"]); + } + catch (LLCertException &cert_exception) + { + LL_WARNS("LLStartup", "SECAPI") << "Caught " << cert_exception.what() << " certificate expception on getCertificate()" << LL_ENDL; + LLSD args; + args["REASON"] = LLTrans::getString(cert_exception.what()); + + LLNotificationsUtil::add("GeneralCertificateError", args, response, + general_cert_done); + + reset_login(); + gSavedSettings.setBOOL("AutoLogin", FALSE); + show_connect_box = true; + } if(certificate) { LLSD args = transform_cert_args(certificate); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 73ee8332cc..30416768cd 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -108,6 +108,7 @@ Voice Server Version: [VOICE_VERSION] The certificate returned by the server could not be used for SSL. Please contact your Grid administrator. Too many certificates were in the servers Certificate chain. Please contact your Grid administrator. The certificate signature returned by the Grid server could not be verified. Please contact your Grid administrator. + Failed to allocate openssl memory for certificate. Network error: Could not establish connection, please check your network connection. Login failed. From 0e0ba2fd866e6f6f3b89008dbe7d3a8e0c826ff5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Aug 2020 00:37:23 +0300 Subject: [PATCH 05/20] SL-13830 One more coroutine crash --- indra/newview/llvoicevivox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 42a1cf95a7..970570b135 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -411,6 +411,7 @@ void LLVivoxVoiceClient::terminate() } else { + mRelogRequested = false; killGateway(); } } @@ -660,12 +661,18 @@ void LLVivoxVoiceClient::voiceControlCoro() U32 retry = 0; - while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE && !LLApp::isExiting()) { LL_DEBUGS("Voice") << "Suspending voiceControlCoro() momentarily for teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL; llcoro::suspendUntilTimeout(1.0); } + if (LLApp::isExiting()) + { + mIsCoroutineActive = false; + return; + } + do { bool success = startAndConnectSession(); From 85e03a7ad749a702a48da4a6a6d6997c433e8eaa Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Aug 2020 10:29:33 +0300 Subject: [PATCH 06/20] SL-13830 One more coroutine exit crash LLWorld is supposed to first remove region from list, then delete the region, but in case of this crash region was returned by handle from llworld yet was mDead and cleaned up, all in main thread. --- indra/newview/llviewerregion.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2ca045b0c9..b9cf4b07dc 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -298,6 +298,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) ++mSeedCapAttempts; + if (LLApp::isExiting()) + { + return; + } + regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle); if (!regionp) //region was removed { @@ -412,6 +417,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) break; // no retry } + if (LLApp::isExiting()) + { + break; + } + regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle); if (!regionp) //region was removed { @@ -515,6 +525,11 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region continue; } + if (LLApp::isExiting()) + { + break; + } + // remove the http_result from the llsd result.erase("http_result"); From 1cd65a244736d0c11f5740f8a19f8d5459d5d4b6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 25 Aug 2020 22:21:46 +0300 Subject: [PATCH 07/20] SL-13498 Crash at ~LLPersistentNotificationChannel Callstack is clearly broken since it points to LLNotifications::instance().clear(); after 'Goodbye!', my suspicion is that something reinitialized singleton so I fixed cleanup and added some logging to see if there is a dupplicate init --- indra/llui/llnotifications.cpp | 32 +++++++++++++++++++------------- indra/llui/llnotifications.h | 2 ++ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 6a7075301b..06ec648178 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -255,7 +255,7 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd) } else { - LL_WARNS() << "Invalid form data " << sd << LL_ENDL; + LL_WARNS("Notifications") << "Invalid form data " << sd << LL_ENDL; mFormData = LLSD::emptyArray(); } } @@ -448,11 +448,11 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mUniqueContext.push_back(context.value); } - LL_DEBUGS() << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL; + LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL; BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags) { - LL_DEBUGS() << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL; + LL_DEBUGS("Notifications") << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL; mTags.push_back(tag.value); } @@ -1398,8 +1398,14 @@ void LLNotifications::initSingleton() createDefaultChannels(); } +void LLNotifications::cleanupSingleton() +{ + clear(); +} + void LLNotifications::createDefaultChannels() { + LL_INFOS("Notifications") << "Generating default notification channels" << LL_ENDL; // now construct the various channels AFTER loading the notifications, // because the history channel is going to rewrite the stored notifications file mDefaultChannels.push_back(new LLNotificationChannel("Enabled", "", @@ -1455,7 +1461,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op if (selected_item.isUndefined()) { - LL_WARNS() << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL; + LL_WARNS("Notifications") << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL; return; } response[selected_item["name"].asString()] = true; @@ -1489,12 +1495,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements) if (found != replacements.end()) { replacement = found->second; - LL_DEBUGS() << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL; + LL_DEBUGS("Notifications") << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL; it->second->setValue(replacement); } else { - LL_WARNS() << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL; + LL_WARNS("Notifications") << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL; } } } @@ -1533,7 +1539,7 @@ void addPathIfExists(const std::string& new_path, std::vector& path bool LLNotifications::loadTemplates() { - LL_INFOS() << "Reading notifications template" << LL_ENDL; + LL_INFOS("Notifications") << "Reading notifications template" << LL_ENDL; // Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it // output all relevant pathnames instead of just the ones from the most // specific skin. @@ -1604,7 +1610,7 @@ bool LLNotifications::loadTemplates() mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification)); } - LL_INFOS() << "...done" << LL_ENDL; + LL_INFOS("Notifications") << "...done" << LL_ENDL; return true; } @@ -1832,7 +1838,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++) { // An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule. - LL_DEBUGS() + LL_DEBUGS("Notifications") << "notification \"" << n->getName() << "\" " << "testing against " << ((*it)->mVisible?"show":"hide") << " rule, " << "name = \"" << (*it)->mName << "\" " @@ -1877,7 +1883,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) if((*it)->mResponse.empty()) { // Response property is empty. Cancel this notification. - LL_DEBUGS() << "cancelling notification " << n->getName() << LL_ENDL; + LL_DEBUGS("Notifications") << "cancelling notification " << n->getName() << LL_ENDL; cancel(n); } @@ -1888,7 +1894,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) // TODO: verify that the response template has an item with the correct name response[(*it)->mResponse] = true; - LL_DEBUGS() << "responding to notification " << n->getName() << " with response = " << response << LL_ENDL; + LL_DEBUGS("Notifications") << "responding to notification " << n->getName() << " with response = " << response << LL_ENDL; n->respond(response); } @@ -1900,7 +1906,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) break; } - LL_DEBUGS() << "allowing notification " << n->getName() << LL_ENDL; + LL_DEBUGS("Notifications") << "allowing notification " << n->getName() << LL_ENDL; return true; } @@ -1961,7 +1967,7 @@ void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id, // from PE merge - we should figure out if this is the right thing to do if (name.empty()) { - LL_WARNS() << "Empty name received for Id: " << agent_id << LL_ENDL; + LL_WARNS("Notifications") << "Empty name received for Id: " << agent_id << LL_ENDL; name = SYSTEM_FROM; } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index cac687f53d..2f4578da17 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -957,6 +957,7 @@ public: private: /*virtual*/ void initSingleton(); + /*virtual*/ void cleanupSingleton(); void loadPersistentNotifications(); @@ -1069,6 +1070,7 @@ public: LLPersistentNotificationChannel() : LLNotificationChannel("Persistent", "Visible", ¬ificationFilter) {} + virtual ~LLPersistentNotificationChannel() {} typedef std::vector history_list_t; history_list_t::iterator beginHistory() { sortHistory(); return mHistory.begin(); } From 31c13ffe251a6b638ace0f14e20ccbfaf9adcb1b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Aug 2020 16:27:16 +0300 Subject: [PATCH 08/20] SL-10326 Fixed avatar rotation of selected avatars and selected self --- indra/newview/llmaniprotate.cpp | 23 ++++++++++++++++++++++- indra/newview/llmaniprotate.h | 1 + indra/newview/llviewerwindow.cpp | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index f158aae3d2..c3e39429a2 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -447,6 +447,7 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) } mMouseCur = mMouseDown; + mAgentSelfAtAxis = gAgent.getAtAxis(); // no point checking if avatar was selected, just save the value // Route future Mouse messages here preemptively. (Release on mouse up.) setMouseCapture( TRUE ); @@ -610,6 +611,26 @@ void LLManipRotate::drag( S32 x, S32 y ) else { object->setRotation(new_rot, damped); + LLVOAvatar* avatar = object->asAvatar(); + if (avatar && avatar->isSelf() + && LLSelectMgr::getInstance()->mAllowSelectAvatar + && !object->getParent()) + { + // Normal avatars use object's orienttion, but self uses + // separate LLCoordFrame + // See LVOAvatar::updateOrientation() + if (gAgentCamera.getFocusOnAvatar()) + { + //Don't rotate camera with avatar + gAgentCamera.setFocusOnAvatar(false, false, false); + } + + LLVector3 at_axis = mAgentSelfAtAxis; + at_axis *= mRotation; + at_axis.mV[VZ] = 0.f; + at_axis.normalize(); + gAgent.resetAxes(at_axis); + } rebuild(object); } @@ -717,7 +738,7 @@ void LLManipRotate::drag( S32 x, S32 y ) LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && - !cur->isAvatar()) + (!cur->isAvatar() || LLSelectMgr::getInstance()->mAllowSelectAvatar)) { selectNode->mLastRotation = cur->getRotation(); selectNode->mLastPositionLocal = cur->getPosition(); diff --git a/indra/newview/llmaniprotate.h b/indra/newview/llmaniprotate.h index e8f1c24c58..dc36ef796a 100644 --- a/indra/newview/llmaniprotate.h +++ b/indra/newview/llmaniprotate.h @@ -95,6 +95,7 @@ private: LLVector3 mMouseDown; LLVector3 mMouseCur; + LLVector3 mAgentSelfAtAxis; // Own agent uses separate rotation method F32 mRadiusMeters; LLVector3 mCenterToCam; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 347acfe15f..5b83cf7163 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3930,7 +3930,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, draw_handles = FALSE; } - if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move) + if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isMovableAvatarSelected()) { draw_handles = FALSE; } From be48bee98f3da0e956a777f4478e010fed7c66eb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Aug 2020 12:33:32 +0300 Subject: [PATCH 09/20] SL-13835 Fixed warning for certificate --- indra/newview/llstartup.cpp | 4 ++-- indra/newview/skins/default/xui/en/notifications.xml | 11 +++++++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b130fd281c..3ef2d47d37 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1134,11 +1134,11 @@ bool idle_startup() } catch (LLCertException &cert_exception) { - LL_WARNS("LLStartup", "SECAPI") << "Caught " << cert_exception.what() << " certificate expception on getCertificate()" << LL_ENDL; + LL_WARNS("LLStartup", "SECAPI") << "Caught " << cert_exception.what() << " certificate expception on getCertificate("<< response["certificate"] << ")" << LL_ENDL; LLSD args; args["REASON"] = LLTrans::getString(cert_exception.what()); - LLNotificationsUtil::add("GeneralCertificateError", args, response, + LLNotificationsUtil::add("GeneralCertificateErrorShort", args, response, general_cert_done); reset_login(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 32a801e1a3..a0d56a0d08 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3691,6 +3691,17 @@ Could not teleport to [SLURL] as it's on a different grid ([GRID]) than the curr yestext="OK"/> + +Could not connect to the server. +[REASON] + fail + + + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 30416768cd..8a7923dd26 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -107,6 +107,7 @@ Voice Server Version: [VOICE_VERSION] The certificate returned by the Grid appears to be expired. Please check your system clock, or contact your Grid administrator. The certificate returned by the server could not be used for SSL. Please contact your Grid administrator. Too many certificates were in the servers Certificate chain. Please contact your Grid administrator. + Could not load cetrificate. Please contact your Grid administrator. The certificate signature returned by the Grid server could not be verified. Please contact your Grid administrator. Failed to allocate openssl memory for certificate. From a8b5ca77dc7bb3afb64df7910a3751d799c1ac74 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 27 Aug 2020 17:27:11 +0300 Subject: [PATCH 10/20] SL-13835 Typo --- indra/newview/skins/default/xui/en/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 8a7923dd26..585cf3f001 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -107,7 +107,7 @@ Voice Server Version: [VOICE_VERSION] The certificate returned by the Grid appears to be expired. Please check your system clock, or contact your Grid administrator. The certificate returned by the server could not be used for SSL. Please contact your Grid administrator. Too many certificates were in the servers Certificate chain. Please contact your Grid administrator. - Could not load cetrificate. Please contact your Grid administrator. + Could not load certificate. Please contact your Grid administrator. The certificate signature returned by the Grid server could not be verified. Please contact your Grid administrator. Failed to allocate openssl memory for certificate. From 2f52a37e6a240a4a950779f2ef769a4fbd3baaf5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Aug 2020 23:01:20 +0300 Subject: [PATCH 11/20] SL-13811 Crash on coroprocedure --- indra/llmessage/llcoproceduremanager.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 969cd162fb..2494c31613 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -77,12 +77,12 @@ public: /// inline size_t countActive() const { - return mActiveCoprocs.size(); + return mActiveCoprocsCount; } /// Returns the total number of coprocedures either queued or in active processing. /// - inline size_t count() const + inline S32 count() const { return countPending() + countActive(); } @@ -113,12 +113,10 @@ private: // because the consuming coroutine might outlive this LLCoprocedurePool // instance. typedef boost::shared_ptr CoprocQueuePtr; - typedef std::map ActiveCoproc_t; std::string mPoolName; - size_t mPoolSize, mPending{0}; + size_t mPoolSize, mActiveCoprocsCount, mPending; CoprocQueuePtr mPendingCoprocs; - ActiveCoproc_t mActiveCoprocs; LLTempBoundListener mStatusListener; typedef std::map CoroAdapterMap_t; @@ -281,6 +279,8 @@ void LLCoprocedureManager::close(const std::string &pool) LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPoolName(poolName), mPoolSize(size), + mActiveCoprocsCount(0), + mPending(0), mPendingCoprocs(boost::make_shared(DEFAULT_QUEUE_SIZE)), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() @@ -406,8 +406,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } // we actually popped an item --mPending; - - ActiveCoproc_t::iterator itActive = mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)).first; + mActiveCoprocsCount++; LL_DEBUGS("CoProcMgr") << "Dequeued and invoking coprocedure(" << coproc->mName << ") with id=" << coproc->mId.asString() << " in pool \"" << mPoolName << "\" (" << mPending << " left)" << LL_ENDL; @@ -417,10 +416,6 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } catch (const LLCoros::Stop &) { - LL_INFOS("CoProcMgr") << "Viewer is shutting Down. Stopping coprocedure('" << coproc->mName - << "', id=" << coproc->mId.asString() - << ") in pool '" << mPoolName << "'" << LL_ENDL; - mActiveCoprocs.erase(itActive); throw; // let toplevel handle this as LLContinueError } catch (...) @@ -429,13 +424,13 @@ void LLCoprocedurePool::coprocedureInvokerCoro( << "', id=" << coproc->mId.asString() << ") in pool '" << mPoolName << "'")); // must NOT omit this or we deplete the pool - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; continue; } LL_DEBUGS("CoProcMgr") << "Finished coprocedure(" << coproc->mName << ")" << " in pool \"" << mPoolName << "\"" << LL_ENDL; - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; } } From a42045994dacbf687cb986d8f1a644f0399cffb5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Aug 2020 01:22:35 +0300 Subject: [PATCH 12/20] SL-13555 'Second Life quit unexpectedly' error message --- indra/llmessage/llcoproceduremanager.cpp | 4 +++- indra/newview/llappearancemgr.cpp | 13 +++++++++++++ indra/newview/llvoicevivox.cpp | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 2494c31613..26684a4d9e 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -414,8 +414,10 @@ void LLCoprocedurePool::coprocedureInvokerCoro( { coproc->mProc(httpAdapter, coproc->mId); } - catch (const LLCoros::Stop &) + catch (const LLCoros::Stop &e) { + LL_INFOS("LLCoros") << "coprocedureInvokerCoro terminating because " + << e.what() << LL_ENDL; throw; // let toplevel handle this as LLContinueError } catch (...) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1a33059188..168b8eb47a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3582,6 +3582,10 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd } llcoro::suspend(); + if (LLApp::isQuitting()) + { + return; + } S32 retryCount(0); bool bRetry; do @@ -3645,6 +3649,11 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData); + if (LLApp::isQuitting()) + { + return; + } + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -3680,6 +3689,10 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LL_WARNS("Avatar") << "Bake retry #" << retryCount << " in " << timeout << " seconds." << LL_ENDL; llcoro::suspendUntilTimeout(timeout); + if (LLApp::isQuitting()) + { + return; + } bRetry = true; continue; } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 970570b135..7b6d9613ac 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1740,6 +1740,12 @@ bool LLVivoxVoiceClient::waitForChannel() mIsProcessingChannels = true; llcoro::suspend(); + if (LLApp::isExiting()) + { + mRelogRequested = false; + break; + } + if (mTuningMode) { performMicTuning(); @@ -1784,6 +1790,13 @@ bool LLVivoxVoiceClient::waitForChannel() { llcoro::suspendUntilTimeout(1.0); } + + if (LLApp::isExiting()) + { + mRelogRequested = false; + break; + } + } while (mVoiceEnabled && !mRelogRequested); LL_DEBUGS("Voice") @@ -1813,7 +1826,7 @@ bool LLVivoxVoiceClient::waitForChannel() << " RelogRequested=" << mRelogRequested << " VoiceEnabled=" << mVoiceEnabled << LL_ENDL; - return true; + return !LLApp::isExiting(); } bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) From 2fe897940149039d5f9079bcc4bf73b017e03720 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Sep 2020 09:54:31 +0300 Subject: [PATCH 13/20] SL-13894 Abuse Report Screenshot should always include UI --- indra/newview/llfloaterreporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 702d612343..7bfba2a6d7 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -930,7 +930,7 @@ void LLFloaterReporter::takeNewSnapshot() // Take a screenshot, but don't draw this floater. setVisible(FALSE); - if (!gViewerWindow->rawSnapshot(mImageRaw, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE, gSavedSettings.getBOOL("RenderHUDInSnapshot"), TRUE, FALSE)) + if (!gViewerWindow->rawSnapshot(mImageRaw,IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE, TRUE /*UI*/, TRUE, FALSE)) { LL_WARNS() << "Unable to take screenshot" << LL_ENDL; setVisible(TRUE); From 4ebba5b91845b7cccd3af697da3fd71fb0779ab5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Sep 2020 09:22:46 +0300 Subject: [PATCH 14/20] SL-13891 Coroutine creation was requested on exit --- indra/llmessage/llexperiencecache.cpp | 16 ++++++++-------- indra/llmessage/llexperiencecache.h | 2 +- indra/newview/llcompilequeue.cpp | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 7d96ac4b02..64c01bd9eb 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -85,15 +85,15 @@ const F64 LLExperienceCache::DEFAULT_EXPIRATION = 600.0; const S32 LLExperienceCache::DEFAULT_QUOTA = 128; // this is megabytes const int LLExperienceCache::SEARCH_PAGE_SIZE = 30; +bool LLExperienceCache::sShutdown = false; + //========================================================================= -LLExperienceCache::LLExperienceCache(): - mShutdown(false) +LLExperienceCache::LLExperienceCache() { } LLExperienceCache::~LLExperienceCache() { - } void LLExperienceCache::initSingleton() @@ -122,7 +122,7 @@ void LLExperienceCache::cleanup() { cache_stream << (*this); } - mShutdown = true; + sShutdown = true; } //------------------------------------------------------------------------- @@ -344,7 +344,7 @@ void LLExperienceCache::requestExperiences() ostr << urlBase << "?page_size=" << PAGE_SIZE1; RequestQueue_t requests; - while (!mRequestQueue.empty()) + while (!mRequestQueue.empty() && !sShutdown) { RequestQueue_t::iterator it = mRequestQueue.begin(); LLUUID key = (*it); @@ -398,8 +398,6 @@ void LLExperienceCache::idleCoro() LL_INFOS("ExperienceCache") << "Launching Experience cache idle coro." << LL_ENDL; do { - llcoro::suspendUntilTimeout(SECS_BETWEEN_REQUESTS); - if (mEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT)) { eraseExpired(); @@ -410,7 +408,9 @@ void LLExperienceCache::idleCoro() requestExperiences(); } - } while (!mShutdown); + llcoro::suspendUntilTimeout(SECS_BETWEEN_REQUESTS); + + } while (!sShutdown); // The coroutine system will likely be shut down by the time we get to this point // (or at least no further cycling will occur on it since the user has decided to quit.) diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index f9ff69c2b6..1c97133723 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -142,7 +142,7 @@ private: LLFrameTimer mEraseExpiredTimer; // Periodically clean out expired entries from the cache CapabilityQuery_t mCapability; std::string mCacheFileName; - bool mShutdown; + static bool sShutdown; // control for coroutines, they exist out of LLExperienceCache's scope, so they need a static control void idleCoro(); void eraseExpired(); diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 76e16f5a1f..3aaaaf52f5 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -347,6 +347,13 @@ void LLFloaterCompileQueue::processExperienceIdResults(LLSD result, LLUUID paren bool LLFloaterCompileQueue::processScript(LLHandle hfloater, const LLPointer &object, LLInventoryObject* inventory, LLEventPump &pump) { + if (LLApp::isQuitting()) + { + // Reply from coroutine came on shutdown + // We are quiting, don't start any more coroutines! + return true; + } + LLSD result; LLCheckedHandle floater(hfloater); // Dereferencing floater may fail. If they do they throw LLExeceptionStaleHandle. @@ -381,6 +388,8 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat result = llcoro::suspendUntilEventOnWithTimeout(pump, fetch_timeout, LLSDMap("timeout", LLSD::Boolean(true))); + floater.check(); + if (result.has("timeout")) { // A timeout filed in the result will always be true if present. LLStringUtil::format_map_t args; @@ -404,6 +413,12 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat } + if (!gAssetStorage) + { + // viewer likely is shutting down + return true; + } + { HandleScriptUserData userData(pump.getName()); @@ -468,6 +483,8 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat result = llcoro::suspendUntilEventOnWithTimeout(pump, fetch_timeout, LLSDMap("timeout", LLSD::Boolean(true))); + floater.check(); + if (result.has("timeout")) { // A timeout filed in the result will always be true if present. LLStringUtil::format_map_t args; @@ -797,6 +814,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L // but offers no guarantee of doing so. llcoro::suspend(); } + floater.check(); } floater->addStringMessage("Done"); From 128f0833cf8076a0eb76eb672017ac54c272ca79 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 1 Sep 2020 23:12:31 +0300 Subject: [PATCH 15/20] Updated LLCA to codeticket build 548269 --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index e6e92b93d3..1416899483 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2187,16 +2187,16 @@ archive hash - 8501cbaa7e0f254614694da784a9c61c + b677ee43822212f0a27c838dc8bf3623 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64944/606925/llca-202008010216.546021-common-546021.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/67622/646614/llca-202009010215.548269-common-548269.tar.bz2 name common version - 202008010216.546021 + 202009010215.548269 llphysicsextensions_source From 645393c5e976a9a6164453bf7df588ec745f04c5 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 4 Sep 2020 17:34:57 +0300 Subject: [PATCH 16/20] SL-13910 Added the TLS Web Server Authentication certificate check --- indra/newview/llsecapi.h | 1 + indra/newview/llsechandler_basic.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 69b6b32923..c2fdbeb8e9 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -75,6 +75,7 @@ #define CERT_EXTENDED_KEY_USAGE "extendedKeyUsage" #define CERT_EKU_SERVER_AUTH SN_server_auth +#define CERT_EKU_TLS_SERVER_AUTH LN_server_auth #define CERT_SUBJECT_KEY_IDENTFIER "subjectKeyIdentifier" #define CERT_AUTHORITY_KEY_IDENTIFIER "authorityKeyIdentifier" diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 55e49100c3..109a2133b8 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -925,8 +925,11 @@ void _validateCert(int validation_policy, } // only validate EKU if the cert has it if(current_cert_info.has(CERT_EXTENDED_KEY_USAGE) && current_cert_info[CERT_EXTENDED_KEY_USAGE].isArray() && - (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], - LLSD((std::string)CERT_EKU_SERVER_AUTH)))) + ( (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], + LLSD((std::string)CERT_EKU_SERVER_AUTH))) + || (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], + LLSD((std::string)CERT_EKU_TLS_SERVER_AUTH))) + )) { LLTHROW(LLCertKeyUsageValidationException(current_cert_info)); } From 786de05651f25d42aacc92c4905375bf1fbd6562 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Sat, 5 Sep 2020 00:20:49 +0300 Subject: [PATCH 17/20] SL-13910 Moved the LLCertException constructor to .cpp --- indra/newview/llsecapi.cpp | 7 +++++++ indra/newview/llsecapi.h | 6 +----- indra/newview/tests/llsechandler_basic_test.cpp | 8 ++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 10e510b842..26a2df8270 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -154,3 +154,10 @@ void LLCredential::authenticatorType(std::string &idType) } } + +LLCertException::LLCertException(const LLSD& cert_data, const std::string& msg) + : LLException(msg), + mCertData(cert_data) +{ + LL_WARNS("SECAPI") << "Certificate Error: " << msg << LL_ENDL; +} diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index c2fdbeb8e9..9c9c16d5d7 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -335,11 +335,7 @@ std::ostream& operator <<(std::ostream& s, const LLCredential& cred); class LLCertException: public LLException { public: - LLCertException(const LLSD& cert_data, const std::string& msg): LLException(msg), - mCertData(cert_data) - { - LL_WARNS("SECAPI") << "Certificate Error: " << msg << LL_ENDL; - } + LLCertException(const LLSD& cert_data, const std::string& msg); virtual ~LLCertException() throw() {} LLSD getCertData() const { return mCertData; } protected: diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 63967fae37..e5d226a2a4 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -124,6 +124,14 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) S32 LLMachineID::init() { return 1; } +LLCertException::LLCertException(const LLSD& cert_data, const std::string& msg) + : LLException(msg), + mCertData(cert_data) +{ + LL_WARNS("SECAPI") << "Certificate Error: " << msg << LL_ENDL; +} + + // ------------------------------------------------------------------------------------------- // TUT // ------------------------------------------------------------------------------------------- From 863eec6676259ef8dc433588972f177d0ee80d6d Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 9 Sep 2020 00:47:28 +0300 Subject: [PATCH 18/20] Revert "SL-12475 Mac buildfix" This reverts commit 25fd4c2ba7bc00a0603bf58f5897ac550ff02446. --- indra/newview/llinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index eda5479cb4..912a4ac92e 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -351,7 +351,7 @@ public: void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); protected: - LLInventoryFavoriteItemsPanel(const Params& params); + LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } void updateFavoritesRootFolder(); From d50131c0ac43cb5cfc247bd388a10100bc3dfec0 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 9 Sep 2020 00:49:09 +0300 Subject: [PATCH 19/20] Revert "SL-12475 add Inventory Favorites tab" This reverts commit 92499ce1b43fd60ce7aad71d12f9eef0cef04f7f. # Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp # indra/newview/llinventorypanel.h --- indra/llui/llfolderview.h | 2 - .../app_settings/settings_per_account.xml | 11 --- indra/newview/llinventorybridge.cpp | 58 ++--------- indra/newview/llinventorymodel.cpp | 5 - indra/newview/llinventorypanel.cpp | 95 ------------------- indra/newview/llinventorypanel.h | 22 ----- indra/newview/llpanelmaininventory.cpp | 12 +-- indra/newview/llpanelmaininventory.h | 2 - .../skins/default/xui/en/menu_inventory.xml | 7 -- .../default/xui/en/panel_main_inventory.xml | 40 +++----- .../newview/skins/default/xui/en/strings.xml | 1 - 11 files changed, 24 insertions(+), 231 deletions(-) diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index c175034d75..6bb5e6c02e 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -241,8 +241,6 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; - - void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; } bool useLabelSuffix() { return mUseLabelSuffix; } virtual void updateMenu(); diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 3d77ac43e5..537744b44c 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -403,17 +403,6 @@ Value - FavoritesFolder - - Comment - User's chosen folder which will be shown in the Favorites tab (UUID) - Persist - 1 - Type - String - Value - - SnapshotBaseDir Comment diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 03123689c5..539d80532c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -138,35 +138,6 @@ bool isMarketplaceSendAction(const std::string& action) return ("send_to_marketplace" == action); } -bool isPanelActive(const std::string& panel_name) -{ - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - return (active_panel && (active_panel->getName() == panel_name)); -} - -bool isParentSystemFolder(const LLInventoryModel* model, const LLUUID& folder_id) -{ - if (!model || folder_id.isNull()) return false; - - LLViewerInventoryCategory* cat = model->getCategory(folder_id); - if (cat) - { - if (cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY) - { - return false; - } - if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) - { - return true; - } - else - { - return isParentSystemFolder(model, cat->getParentUUID()); - } - } - return false; -} - // Used by LLFolderBridge as callback for directory fetching recursion class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { @@ -917,7 +888,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Properties")); } - if (!isPanelActive("All Items")) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() != "All Items")) { items.push_back(std::string("Show in Main Panel")); } @@ -1008,7 +980,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable() || isPanelActive("Favorite Items")) + if (!isItemRemovable()) { disabled_items.push_back(std::string("Delete")); } @@ -4038,7 +4010,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); - disabled_items.push_back(std::string("Set Favorites folder")); } if (favorites == mUUID) { @@ -4066,7 +4037,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); - disabled_items.push_back(std::string("Set Favorites folder")); } if (marketplace_listings_id == mUUID) { @@ -4075,14 +4045,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } - - if (isPanelActive("Favorite Items")) - { - disabled_items.push_back(std::string("Delete")); - } if(trash_id == mUUID) { - bool is_recent_panel = isPanelActive("Recent Items"); + bool is_recent_panel = false; + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() == "Recent Items")) + { + is_recent_panel = true; + } // This is the trash. items.push_back(std::string("Empty Trash")); @@ -4131,16 +4101,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Body Parts")); items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); - - if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) - { - items.push_back(std::string("Set Favorites folder")); - } - if (!LLEnvironment::instance().isInventoryEnabled()) - { - disabled_items.push_back("New Settings"); - } - } } getClipboardEntries(false, items, disabled_items, flags); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a44a54632c..17e80dca89 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -542,11 +542,6 @@ const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType:: cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder")); break; } - case LLFolderType::FT_FAVORITE: - { - cat_id = LLUUID(gSavedPerAccountSettings.getString("FavoritesFolder")); - break; - } default: break; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 26f1b61fe6..7ff1006773 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -179,7 +179,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); - mCommitCallbackRegistrar.add("Inventory.SetFavoritesFolder", boost::bind(&LLInventoryPanel::setFavoritesFolder, this, _2)); } LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) @@ -1375,11 +1374,6 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) } } -void LLInventoryPanel::setFavoritesFolder(const LLSD& userdata) -{ - gSavedPerAccountSettings.setString("FavoritesFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); -} - void LLInventoryPanel::purgeSelectedItems() { if (!mFolderRoot.get()) return; @@ -1759,95 +1753,6 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params) mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER; } -static LLDefaultChildRegistry::Register t_favorites_inventory_panel("favorites_inventory_panel"); - -LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params) - : LLInventoryPanel(params) -{ - std::string ctrl_name = "FavoritesFolder"; - if (gSavedPerAccountSettings.controlExists(ctrl_name)) - { - LLPointer cntrl_ptr = gSavedPerAccountSettings.getControl(ctrl_name); - if (cntrl_ptr.notNull()) - { - mFolderChangedSignal = cntrl_ptr->getCommitSignal()->connect(boost::bind(&LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder, this)); - } - } -} - -void LLInventoryFavoriteItemsPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) -{ - if (mFolderRoot.get()) - { - mFolderRoot.get()->setSelectCallback(cb); - mSelectionCallback = cb; - } -} - -void LLInventoryFavoriteItemsPanel::initFromParams(const Params& p) -{ - Params fav_params(p); - fav_params.start_folder.id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); - LLInventoryPanel::initFromParams(fav_params); - updateFavoritesRootFolder(); -} - -void LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder() -{ - const LLUUID& folder_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); - - bool is_favorites_set = (folder_id != gInventory.findCategoryUUIDForTypeInRoot(LLFolderType::FT_FAVORITE, true, gInventory.getRootFolderID())); - - if (!is_favorites_set || folder_id != getRootFolderID()) - { - LLUUID root_id = folder_id; - if (mFolderRoot.get()) - { - removeItemID(getRootFolderID()); - mFolderRoot.get()->destroyView(); - } - - mCommitCallbackRegistrar.pushScope(); - { - LLFolderView* folder_view = createFolderRoot(root_id); - mFolderRoot = folder_view->getHandle(); - - addItemID(root_id, mFolderRoot.get()); - - - LLRect scroller_view_rect = getRect(); - scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params scroller_params(mParams.scroll()); - scroller_params.rect(scroller_view_rect); - - if (mScroller) - { - removeChild(mScroller); - delete mScroller; - mScroller = NULL; - } - mScroller = LLUICtrlFactory::create(scroller_params); - addChild(mScroller); - mScroller->addChild(mFolderRoot.get()); - mFolderRoot.get()->setScrollContainer(mScroller); - mFolderRoot.get()->setFollowsAll(); - mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); - - if (!mSelectionCallback.empty()) - { - mFolderRoot.get()->setSelectCallback(mSelectionCallback); - } - } - mCommitCallbackRegistrar.popScope(); - mFolderRoot.get()->setCallbackRegistrar(&mCommitCallbackRegistrar); - - if (is_favorites_set) - { - buildNewViews(folder_id); - } - mFolderRoot.get()->setShowEmptyMessage(!is_favorites_set); - } -} /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /************************************************************************/ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 912a4ac92e..b51dc17cdd 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -214,7 +214,6 @@ public: void doCreate(const LLSD& userdata); bool beginIMSession(); void fileUploadLocation(const LLSD& userdata); - void setFavoritesFolder(const LLSD& userdata); void purgeSelectedItems(); bool attachObject(const LLSD& userdata); static void idle(void* user_data); @@ -339,27 +338,6 @@ private: bool mViewsInitialized; // Views have been generated }; - -class LLInventoryFavoriteItemsPanel : public LLInventoryPanel -{ -public: - struct Params : public LLInitParam::Block - {}; - - void initFromParams(const Params& p); - bool isSelectionRemovable() { return false; } - void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); - -protected: - LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); - ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } - void updateFavoritesRootFolder(); - - boost::signals2::connection mFolderChangedSignal; - boost::function& items, BOOL user_action)> mSelectionCallback; - friend class LLUICtrlFactory; -}; - /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /* Exchanges filter's flexibility for speed of generation and */ diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 89682d9576..02cd22c307 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -188,16 +188,6 @@ BOOL LLPanelMainInventory::postBuild() worn_filter.markDefault(); mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); } - - mFavoriteItemsPanel = getChild("Favorite Items"); - if (mFavoriteItemsPanel) - { - LLInventoryFilter& recent_filter = mFavoriteItemsPanel->getFilter(); - recent_filter.setEmptyLookupMessage("InventoryFavoritItemsNotSelected"); - recent_filter.markDefault(); - mFavoriteItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoriteItemsPanel, _1, _2)); - } - mSearchTypeCombo = getChild("search_type"); if(mSearchTypeCombo) { @@ -1413,7 +1403,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "delete") { - return getActivePanel()->isSelectionRemovable() && (getActivePanel() != mFavoriteItemsPanel); + return getActivePanel()->isSelectionRemovable(); } if (command_name == "save_texture") { diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c0b4a7b6fc..a6bdee233d 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -37,7 +37,6 @@ class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; -class LLInventoryFavoriteItemsPanel; class LLSaveFolderState; class LLFilterEditor; class LLTabContainer; @@ -137,7 +136,6 @@ private: LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; LLInventoryPanel* mWornItemsPanel; - LLInventoryFavoriteItemsPanel* mFavoriteItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index adefa261aa..9aa84c1bac 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -393,13 +393,6 @@ parameter="model" /> - - - - - + + Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters]. - Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders cannot be used for Favorites. Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. Drag a landmark here to add it to your favorites. No items found. Check the spelling of your search string and try again. From 4eefce9767784742cd394ddf948d345cfbced8c8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 9 Sep 2020 18:05:11 +0300 Subject: [PATCH 20/20] SL-13921 Only one of extended key usages is needed LN (EKU_TLS) is more likely to be present thus should be checked first --- indra/newview/llsechandler_basic.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 656a2cf8cf..737ef30ada 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -924,12 +924,13 @@ void _validateCert(int validation_policy, LLTHROW(LLCertKeyUsageValidationException(current_cert_info)); } // only validate EKU if the cert has it - if(current_cert_info.has(CERT_EXTENDED_KEY_USAGE) && current_cert_info[CERT_EXTENDED_KEY_USAGE].isArray() && - ( (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], + if(current_cert_info.has(CERT_EXTENDED_KEY_USAGE) + && current_cert_info[CERT_EXTENDED_KEY_USAGE].isArray() + && (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], + LLSD((std::string)CERT_EKU_TLS_SERVER_AUTH))) + && (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], LLSD((std::string)CERT_EKU_SERVER_AUTH))) - || (!_LLSDArrayIncludesValue(current_cert_info[CERT_EXTENDED_KEY_USAGE], - LLSD((std::string)CERT_EKU_TLS_SERVER_AUTH))) - )) + ) { LLTHROW(LLCertKeyUsageValidationException(current_cert_info)); }