From 3527e9c0423f8a3c10c9d6e93805540315b285b6 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 18 Jan 2019 16:12:49 +0200 Subject: [PATCH 01/13] SL-3488 Remove "Disable Selected" and "Disable All" Buttons --- indra/newview/llfloatertopobjects.cpp | 41 ++----------------- indra/newview/llfloatertopobjects.h | 11 +---- .../default/xui/en/floater_top_objects.xml | 26 +----------- 3 files changed, 6 insertions(+), 72 deletions(-) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 3e6fc3dc0d..9b5b3a0fc9 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -78,8 +78,6 @@ LLFloaterTopObjects::LLFloaterTopObjects(const LLSD& key) mCommitCallbackRegistrar.add("TopObjects.ShowBeacon", boost::bind(&LLFloaterTopObjects::onClickShowBeacon, this)); mCommitCallbackRegistrar.add("TopObjects.ReturnSelected", boost::bind(&LLFloaterTopObjects::onReturnSelected, this)); mCommitCallbackRegistrar.add("TopObjects.ReturnAll", boost::bind(&LLFloaterTopObjects::onReturnAll, this)); - mCommitCallbackRegistrar.add("TopObjects.DisableSelected", boost::bind(&LLFloaterTopObjects::onDisableSelected, this)); - mCommitCallbackRegistrar.add("TopObjects.DisableAll", boost::bind(&LLFloaterTopObjects::onDisableAll, this)); mCommitCallbackRegistrar.add("TopObjects.Refresh", boost::bind(&LLFloaterTopObjects::onRefresh, this)); mCommitCallbackRegistrar.add("TopObjects.GetByObjectName", boost::bind(&LLFloaterTopObjects::onGetByObjectName, this)); mCommitCallbackRegistrar.add("TopObjects.GetByOwnerName", boost::bind(&LLFloaterTopObjects::onGetByOwnerName, this)); @@ -332,7 +330,7 @@ void LLFloaterTopObjects::onClickShowBeacon() showBeacon(); } -void LLFloaterTopObjects::doToObjects(int action, bool all) +void LLFloaterTopObjects::returnObjects(bool all) { LLMessageSystem *msg = gMessageSystem; @@ -356,14 +354,7 @@ void LLFloaterTopObjects::doToObjects(int action, bool all) } if (start_message) { - if (action == ACTION_RETURN) - { - msg->newMessageFast(_PREHASH_ParcelReturnObjects); - } - else - { - msg->newMessageFast(_PREHASH_ParcelDisableObjects); - } + msg->newMessageFast(_PREHASH_ParcelReturnObjects); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); @@ -397,7 +388,7 @@ bool LLFloaterTopObjects::callbackReturnAll(const LLSD& notification, const LLSD if(!instance) return false; if (option == 0) { - instance->doToObjects(ACTION_RETURN, true); + instance->returnObjects(true); } return false; } @@ -410,31 +401,7 @@ void LLFloaterTopObjects::onReturnAll() void LLFloaterTopObjects::onReturnSelected() { - doToObjects(ACTION_RETURN, false); -} - - -//static -bool LLFloaterTopObjects::callbackDisableAll(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance("top_objects"); - if(!instance) return false; - if (option == 0) - { - instance->doToObjects(ACTION_DISABLE, true); - } - return false; -} - -void LLFloaterTopObjects::onDisableAll() -{ - LLNotificationsUtil::add("DisableAllTopObjects", LLSD(), LLSD(), callbackDisableAll); -} - -void LLFloaterTopObjects::onDisableSelected() -{ - doToObjects(ACTION_DISABLE, false); + returnObjects(false); } diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h index dbbe9ac521..3138249c7a 100644 --- a/indra/newview/llfloatertopobjects.h +++ b/indra/newview/llfloatertopobjects.h @@ -78,15 +78,12 @@ private: static void onDoubleClickObjectsList(void* data); void onClickShowBeacon(); - void doToObjects(int action, bool all); + void returnObjects(bool all); void onReturnAll(); void onReturnSelected(); - void onDisableAll(); - void onDisableSelected(); static bool callbackReturnAll(const LLSD& notification, const LLSD& response); - static bool callbackDisableAll(const LLSD& notification, const LLSD& response); void onGetByOwnerName(); void onGetByObjectName(); @@ -108,12 +105,6 @@ private: F32 mtotalScore; - enum - { - ACTION_RETURN = 0, - ACTION_DISABLE - }; - static LLFloaterTopObjects* sInstance; }; diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml index 36ceddd305..ceef541290 100644 --- a/indra/newview/skins/default/xui/en/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -2,7 +2,7 @@ - - From af0e498293c86dc7bb1ae7911bf932b7b287e115 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 21 Jan 2019 17:45:26 +0200 Subject: [PATCH 02/13] =?UTF-8?q?SL-10338=20FIXED=20The=20=E2=80=9Cadd=20f?= =?UTF-8?q?riend=E2=80=9D=20button=20is=20available=20when=20user=20is=20a?= =?UTF-8?q?lready=20at=20your=20friends=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llchatitemscontainerctrl.cpp | 2 ++ indra/newview/llfloaterland.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index eddc87efcd..4f42868f1a 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -29,6 +29,7 @@ #include "llchatitemscontainerctrl.h" #include "lltextbox.h" +#include "llavataractions.h" #include "llavatariconctrl.h" #include "llcommandhandler.h" #include "llfloaterreg.h" @@ -204,6 +205,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) mMsgText = getChild("msg_text", false); mMsgText->setContentTrusted(false); + mMsgText->setIsFriendCallback(LLAvatarActions::isFriend); mMsgText->setText(std::string("")); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 88b3fb7b96..a462f391ca 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -415,6 +415,7 @@ BOOL LLPanelLandGeneral::postBuild() mTextSalePending = getChild("SalePending"); mTextOwnerLabel = getChild("Owner:"); mTextOwner = getChild("OwnerText"); + mTextOwner->setIsFriendCallback(LLAvatarActions::isFriend); mContentRating = getChild("ContentRatingText"); mLandType = getChild("LandTypeText"); @@ -1191,6 +1192,7 @@ BOOL LLPanelLandObjects::postBuild() mIconGroup = LLUIImageList::getInstance()->getUIImage("icon_group.tga", 0); mOwnerList = getChild("owner list"); + mOwnerList->setIsFriendCallback(LLAvatarActions::isFriend); mOwnerList->sortByColumnIndex(3, FALSE); childSetCommitCallback("owner list", onCommitList, this); mOwnerList->setDoubleClickCallback(onDoubleClickOwner, this); From 8a92a771ba547d9d6a8bd1234e2e0b144a8bfcf5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 15 Jan 2019 22:27:28 +0200 Subject: [PATCH 03/13] SL-10291 Replace apr thread with standard C++11 functionality --- indra/llcommon/llthread.cpp | 77 ++++++--------- indra/llcommon/llthread.h | 12 +-- indra/llcommon/llthreadsafequeue.cpp | 81 ---------------- indra/llcommon/llthreadsafequeue.h | 135 ++++++++++++++------------- indra/newview/llmainlooprepeater.cpp | 2 +- 5 files changed, 104 insertions(+), 203 deletions(-) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 860415bb22..a4171729db 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -116,29 +116,27 @@ void LLThread::registerThreadID() // // Handed to the APR thread creation function // -void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap) +void LLThread::threadRun() { - LLThread *threadp = (LLThread *)datap; - #ifdef LL_WINDOWS - set_thread_name(-1, threadp->mName.c_str()); + set_thread_name(-1, mName.c_str()); #endif // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread - threadp->mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); + mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); - sThreadID = threadp->mID; + sThreadID = mID; // Run the user supplied function do { try { - threadp->run(); + run(); } catch (const LLContinueError &e) { - LL_WARNS("THREAD") << "ContinueException on thread '" << threadp->mName << + LL_WARNS("THREAD") << "ContinueException on thread '" << mName << "' reentering run(). Error what is: '" << e.what() << "'" << LL_ENDL; //output possible call stacks to log file. LLError::LLCallStacks::print(); @@ -153,39 +151,25 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL; - delete threadp->mRecorder; - threadp->mRecorder = NULL; + delete mRecorder; + mRecorder = NULL; // We're done with the run function, this thread is done executing now. //NB: we are using this flag to sync across threads...we really need memory barriers here // Todo: add LLMutex per thread instead of flag? // We are using "while (mStatus != STOPPED) {ms_sleep();}" everywhere. - threadp->mStatus = STOPPED; - - return NULL; + mStatus = STOPPED; } LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : mPaused(FALSE), mName(name), - mAPRThreadp(NULL), + mThreadp(NULL), mStatus(STOPPED), mRecorder(NULL) { mID = ++sIDIter; - - // Thread creation probably CAN be paranoid about APR being initialized, if necessary - if (poolp) - { - mIsLocalPool = FALSE; - mAPRPoolp = poolp; - } - else - { - mIsLocalPool = TRUE; - apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread - } mRunCondition = new LLCondition(); mDataLock = new LLMutex(); mLocalAPRFilePoolp = NULL ; @@ -217,7 +201,7 @@ void LLThread::shutdown() // Warning! If you somehow call the thread destructor from itself, // the thread will die in an unclean fashion! - if (mAPRThreadp) + if (mThreadp) { if (!isStopped()) { @@ -248,14 +232,19 @@ void LLThread::shutdown() { // This thread just wouldn't stop, even though we gave it time //LL_WARNS() << "LLThread::~LLThread() exiting thread before clean exit!" << LL_ENDL; - // Put a stake in its heart. - apr_thread_exit(mAPRThreadp, -1); + // Put a stake in its heart. (A very hostile method to force a thread to quit) +#if LL_WINDOWS + TerminateThread(mNativeHandle, 0); +#else + pthread_cancel(mNativeHandle); +#endif + delete mRecorder; mRecorder = NULL; mStatus = STOPPED; return; } - mAPRThreadp = NULL; + mThreadp = NULL; } delete mRunCondition; @@ -263,12 +252,6 @@ void LLThread::shutdown() delete mDataLock; mDataLock = NULL; - - if (mIsLocalPool && mAPRPoolp) - { - apr_pool_destroy(mAPRPoolp); - mAPRPoolp = 0; - } if (mRecorder) { @@ -287,19 +270,15 @@ void LLThread::start() // Set thread state to running mStatus = RUNNING; - apr_status_t status = - apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, mAPRPoolp); - - if(status == APR_SUCCESS) - { - // We won't bother joining - apr_thread_detach(mAPRThreadp); + try + { + mThreadp = new std::thread(std::bind(&LLThread::threadRun, this)); + mNativeHandle = mThreadp->native_handle(); } - else + catch (std::system_error& ex) { mStatus = STOPPED; - LL_WARNS() << "failed to start thread " << mName << LL_ENDL; - ll_apr_warn_status(status); + LL_WARNS() << "failed to start thread " << mName << " " << ex.what() << LL_ENDL; } } @@ -376,11 +355,7 @@ U32 LLThread::currentID() // static void LLThread::yield() { -#if LL_LINUX || LL_SOLARIS - sched_yield(); // annoyingly, apr_thread_yield is a noop on linux... -#else - apr_thread_yield(); -#endif + std::this_thread::yield(); } void LLThread::wake() diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index dda7fa8ffb..863c9051f3 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -29,10 +29,10 @@ #include "llapp.h" #include "llapr.h" -#include "apr_thread_cond.h" #include "boost/intrusive_ptr.hpp" #include "llmutex.h" #include "llrefcount.h" +#include LL_COMMON_API void assert_main_thread(); @@ -86,7 +86,6 @@ public: // this kicks off the apr thread void start(void); - apr_pool_t *getAPRPool() { return mAPRPoolp; } LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } U32 getID() const { return mID; } @@ -97,19 +96,18 @@ public: static void registerThreadID(); private: - BOOL mPaused; + bool mPaused; + std::thread::native_handle_type mNativeHandle; // for termination in case of issues // static function passed to APR thread creation routine - static void *APR_THREAD_FUNC staticRun(struct apr_thread_t *apr_threadp, void *datap); + void threadRun(); protected: std::string mName; class LLCondition* mRunCondition; LLMutex* mDataLock; - apr_thread_t *mAPRThreadp; - apr_pool_t *mAPRPoolp; - BOOL mIsLocalPool; + std::thread *mThreadp; EThreadStatus mStatus; U32 mID; LLTrace::ThreadRecorder* mRecorder; diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp index 491f920c0f..bde36999ba 100644 --- a/indra/llcommon/llthreadsafequeue.cpp +++ b/indra/llcommon/llthreadsafequeue.cpp @@ -24,87 +24,6 @@ */ #include "linden_common.h" -#include -#include #include "llthreadsafequeue.h" -#include "llexception.h" - -// LLThreadSafeQueueImplementation -//----------------------------------------------------------------------------- - - -LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity): - mOwnsPool(pool == 0), - mPool(pool), - mQueue(0) -{ - if(mOwnsPool) { - apr_status_t status = apr_pool_create(&mPool, 0); - if(status != APR_SUCCESS) LLTHROW(LLThreadSafeQueueError("failed to allocate pool")); - } else { - ; // No op. - } - - apr_status_t status = apr_queue_create(&mQueue, capacity, mPool); - if(status != APR_SUCCESS) LLTHROW(LLThreadSafeQueueError("failed to allocate queue")); -} - - -LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation() -{ - if(mQueue != 0) { - if(apr_queue_size(mQueue) != 0) LL_WARNS() << - "terminating queue which still contains " << apr_queue_size(mQueue) << - " elements;" << "memory will be leaked" << LL_ENDL; - apr_queue_term(mQueue); - } - if(mOwnsPool && (mPool != 0)) apr_pool_destroy(mPool); -} - - -void LLThreadSafeQueueImplementation::pushFront(void * element) -{ - apr_status_t status = apr_queue_push(mQueue, element); - - if(status == APR_EINTR) { - LLTHROW(LLThreadSafeQueueInterrupt()); - } else if(status != APR_SUCCESS) { - LLTHROW(LLThreadSafeQueueError("push failed")); - } else { - ; // Success. - } -} - - -bool LLThreadSafeQueueImplementation::tryPushFront(void * element){ - return apr_queue_trypush(mQueue, element) == APR_SUCCESS; -} - - -void * LLThreadSafeQueueImplementation::popBack(void) -{ - void * element; - apr_status_t status = apr_queue_pop(mQueue, &element); - - if(status == APR_EINTR) { - LLTHROW(LLThreadSafeQueueInterrupt()); - } else if(status != APR_SUCCESS) { - LLTHROW(LLThreadSafeQueueError("pop failed")); - } else { - return element; - } -} - - -bool LLThreadSafeQueueImplementation::tryPopBack(void *& element) -{ - return apr_queue_trypop(mQueue, &element) == APR_SUCCESS; -} - - -size_t LLThreadSafeQueueImplementation::size() -{ - return apr_queue_size(mQueue); -} diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 45289ef0b4..b0bddac8e5 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -28,12 +28,20 @@ #define LL_LLTHREADSAFEQUEUE_H #include "llexception.h" +#include #include +#if LL_WINDOWS +#pragma warning (push) +#pragma warning (disable:4265) +#endif +// 'std::_Pad' : class has virtual functions, but destructor is not virtual +#include +#include -struct apr_pool_t; // From apr_pools.h -class LLThreadSafeQueueImplementation; // See below. - +#if LL_WINDOWS +#pragma warning (pop) +#endif // // A general queue exception. @@ -64,31 +72,6 @@ public: } }; - -struct apr_queue_t; // From apr_queue.h - - -// -// Implementation details. -// -class LL_COMMON_API LLThreadSafeQueueImplementation -{ -public: - LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity); - ~LLThreadSafeQueueImplementation(); - void pushFront(void * element); - bool tryPushFront(void * element); - void * popBack(void); - bool tryPopBack(void *& element); - size_t size(); - -private: - bool mOwnsPool; - apr_pool_t * mPool; - apr_queue_t * mQueue; -}; - - // // Implements a thread safe FIFO. // @@ -100,7 +83,7 @@ public: // If the pool is set to NULL one will be allocated and managed by this // queue. - LLThreadSafeQueue(apr_pool_t * pool = 0, unsigned int capacity = 1024); + LLThreadSafeQueue(U32 capacity = 1024); // Add an element to the front of queue (will block if the queue has // reached capacity). @@ -128,77 +111,103 @@ public: size_t size(); private: - LLThreadSafeQueueImplementation mImplementation; + std::deque< ElementT > mStorage; + U32 mCapacity; + + std::mutex mLock; + std::condition_variable mCapacityCond; + std::condition_variable mEmptyCond; }; - - // LLThreadSafeQueue //----------------------------------------------------------------------------- - template -LLThreadSafeQueue::LLThreadSafeQueue(apr_pool_t * pool, unsigned int capacity): - mImplementation(pool, capacity) +LLThreadSafeQueue::LLThreadSafeQueue(U32 capacity) : +mCapacity(capacity) { - ; // No op. } template void LLThreadSafeQueue::pushFront(ElementT const & element) { - ElementT * elementCopy = new ElementT(element); - try { - mImplementation.pushFront(elementCopy); - } catch (LLThreadSafeQueueInterrupt) { - delete elementCopy; - throw; - } + while (true) + { + std::unique_lock lock1(mLock); + + if (mStorage.size() < mCapacity) + { + mStorage.push_front(element); + mEmptyCond.notify_one(); + return; + } + + // Storage Full. Wait for signal. + mCapacityCond.wait(lock1); + } } template bool LLThreadSafeQueue::tryPushFront(ElementT const & element) { - ElementT * elementCopy = new ElementT(element); - bool result = mImplementation.tryPushFront(elementCopy); - if(!result) delete elementCopy; - return result; + std::unique_lock lock1(mLock, std::defer_lock); + if (!lock1.try_lock()) + return false; + + if (mStorage.size() >= mCapacity) + return false; + + mStorage.push_front(element); + mEmptyCond.notify_one(); + return true; } template ElementT LLThreadSafeQueue::popBack(void) { - ElementT * element = reinterpret_cast (mImplementation.popBack()); - ElementT result(*element); - delete element; - return result; + while (true) + { + std::unique_lock lock1(mLock); + + if (!mStorage.empty()) + { + ElementT value = mStorage.back(); + mStorage.pop_back(); + mCapacityCond.notify_one(); + return value; + } + + // Storage empty. Wait for signal. + mEmptyCond.wait(lock1); + } } template bool LLThreadSafeQueue::tryPopBack(ElementT & element) { - void * storedElement; - bool result = mImplementation.tryPopBack(storedElement); - if(result) { - ElementT * elementPtr = reinterpret_cast(storedElement); - element = *elementPtr; - delete elementPtr; - } else { - ; // No op. - } - return result; + std::unique_lock lock1(mLock, std::defer_lock); + if (!lock1.try_lock()) + return false; + + if (mStorage.empty()) + return false; + + element = mStorage.back(); + mStorage.pop_back(); + mCapacityCond.notify_one(); + return true; } template size_t LLThreadSafeQueue::size(void) { - return mImplementation.size(); + std::lock_guard lock(mLock); + return mStorage.size(); } - #endif diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp index db8d2e4ede..6736e9a950 100644 --- a/indra/newview/llmainlooprepeater.cpp +++ b/indra/newview/llmainlooprepeater.cpp @@ -46,7 +46,7 @@ void LLMainLoopRepeater::start(void) { if(mQueue != 0) return; - mQueue = new LLThreadSafeQueue(gAPRPoolp, 1024); + mQueue = new LLThreadSafeQueue(1024); mMainLoopConnection = LLEventPumps::instance(). obtain("mainloop").listen(LLEventPump::inventName(), boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1)); mRepeaterConnection = LLEventPumps::instance(). From d785c87d620cb17681ea6d3011461154d96ab9d5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 29 Jan 2019 21:33:31 +0200 Subject: [PATCH 04/13] SL-2364 Fixed Viewer Caches Login Host DNS Entries Indefinetely --- indra/llcorehttp/_httpoprequest.cpp | 5 +++++ indra/newview/lllogininstance.cpp | 7 ++++++- indra/newview/llxmlrpctransaction.cpp | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index cc49a2af80..0f76ff23ea 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -555,6 +555,11 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // about 700 or so requests and starts issuing TCP RSTs to // new connections. Reuse the DNS lookups for even a few // seconds and no RSTs. + // + // -1 stores forever + // 0 never stores + // any other positive number specifies seconds + // supposedly curl 7.62.0 can use TTL by default, otherwise default is 60 seconds check_curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, dnsCacheTimeout); if (gpolicy.mUseLLProxy) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bc93fa2c20..bf4fc029ee 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -63,6 +63,9 @@ #include const S32 LOGIN_MAX_RETRIES = 3; +const F32 LOGIN_SRV_TIMEOUT_MIN = 10; +const F32 LOGIN_SRV_TIMEOUT_MAX = 120; +const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time class LLLoginInstance::Disposable { public: @@ -232,8 +235,10 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia // Specify desired timeout/retry options LLSD http_params; - http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); + F32 srv_timeout = llclamp(gSavedSettings.getF32("LoginSRVTimeout"), LOGIN_SRV_TIMEOUT_MIN, LOGIN_SRV_TIMEOUT_MAX); + http_params["timeout"] = srv_timeout; http_params["retries"] = LOGIN_MAX_RETRIES; + http_params["DNSCacheTimeout"] = srv_timeout * LOGIN_DNS_TIMEOUT_FACTOR; //Default: indefinite mRequestData.clear(); mRequestData["method"] = "login_to_simulator"; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index cc223c1f48..8e2539606b 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -362,6 +362,10 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const { httpOpts->setRetries(httpParams["retries"].asInteger()); } + if (httpParams.has("DNSCacheTimeout")) + { + httpOpts->setDNSCacheTimeout(httpParams["DNSCacheTimeout"].asInteger()); + } bool vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert"); mCertStore = gSavedSettings.getString("CertStore"); From d903f8c1a1509c87af9bf5c173cab685be7dee03 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 5 Feb 2019 16:14:27 +0200 Subject: [PATCH 05/13] SL-10470 Fixed freeze due to extensive logging --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventorymodel.cpp | 16 +++++++++++++--- indra/newview/llinventorypanel.cpp | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e7367d5ced..00b7732ee9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1415,7 +1415,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, break; default: - LL_INFOS() << "Unhandled asset type (llassetstorage.h): " + LL_INFOS_ONCE() << "Unhandled asset type (llassetstorage.h): " << (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << LL_ENDL; break; } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a520e0171e..b140c7c38e 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1820,9 +1820,19 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) if (LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) { - LL_WARNS(LOG_INV) << "Got unknown asset type for item [ name: " << item->getName() - << " type: " << item->getType() - << " inv-type: " << item->getInventoryType() << " ]." << LL_ENDL; + if (item->getType() >= LLAssetType::AT_COUNT) + { + // Not yet supported. + LL_DEBUGS(LOG_INV) << "Got unknown asset type for item [ name: " << item->getName() + << " type: " << item->getType() + << " inv-type: " << item->getInventoryType() << " ]." << LL_ENDL; + } + else + { + LL_WARNS(LOG_INV) << "Got unknown asset type for item [ name: " << item->getName() + << " type: " << item->getType() + << " inv-type: " << item->getInventoryType() << " ]." << LL_ENDL; + } } // This condition means that we tried to add a link without the baseobj being in memory. diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3992b506e9..d4993a1091 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -871,7 +871,8 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) if (objectp->getType() >= LLAssetType::AT_COUNT) { - LL_WARNS() << "LLInventoryPanel::buildNewViews called with unknown objectp->mType : " + // Example: Happens when we add assets of new, not yet supported type to library + LL_DEBUGS() << "LLInventoryPanel::buildNewViews called with unknown objectp->mType : " << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << LL_ENDL; From c0abc508f9bdedf05748186472ea433cd8ddd9c6 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 5 Feb 2019 17:30:24 +0200 Subject: [PATCH 06/13] SL-10466 Viewer throwing misleading notification --- indra/newview/llviewermessage.cpp | 29 +++++-------------- .../skins/default/xui/en/notifications.xml | 22 -------------- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 981d226824..e50c8ee9f0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5531,17 +5531,6 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp void script_question_mute(const LLUUID& item_id, const std::string& object_name); -bool unknown_script_question_cb(const LLSD& notification, const LLSD& response) -{ - // Only care if they muted the object here. - if ( response["Mute"] ) // mute - { - LLUUID task_id = notification["payload"]["task_id"].asUUID(); - script_question_mute(task_id,notification["payload"]["object_name"].asString()); - } - return false; -} - void experiencePermissionBlock(LLUUID experience, LLSD result) { LLSD permission; @@ -5647,8 +5636,7 @@ void script_question_mute(const LLUUID& task_id, const std::string& object_name) bool matches(const LLNotificationPtr notification) const { if (notification->getName() == "ScriptQuestionCaution" - || notification->getName() == "ScriptQuestion" - || notification->getName() == "UnknownScriptQuestion") + || notification->getName() == "ScriptQuestion") { return (notification->getPayload()["task_id"].asUUID() == blocked_id); } @@ -5665,7 +5653,6 @@ void script_question_mute(const LLUUID& task_id, const std::string& object_name) static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb); static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestionCaution", script_question_cb); static LLNotificationFunctorRegistration script_question_cb_reg_3("ScriptQuestionExperience", script_question_cb); -static LLNotificationFunctorRegistration unknown_script_question_cb_reg("UnknownScriptQuestion", unknown_script_question_cb); void process_script_experience_details(const LLSD& experience_details, LLSD args, LLSD payload) { @@ -5778,14 +5765,12 @@ void process_script_question(LLMessageSystem *msg, void **user_data) args["QUESTIONS"] = script_question; if (known_questions != questions) - { // This is in addition to the normal dialog. - LLSD payload; - payload["task_id"] = taskid; - payload["item_id"] = itemid; - payload["object_name"] = object_name; - - args["DOWNLOADURL"] = LLTrans::getString("ViewerDownloadURL"); - LLNotificationsUtil::add("UnknownScriptQuestion",args,payload); + { + // This is in addition to the normal dialog. + // Viewer got a request for not supported/implemented permission + LL_WARNS("Messaging") << "Object \"" << object_name << "\" requested " << script_question + << " permission. Permission is unknown and can't be granted. Item id: " << itemid + << " taskid:" << taskid << LL_ENDL; } if (known_questions) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 23a8d21f8a..efc5a30b63 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7766,28 +7766,6 @@ Do not allow access if you do not fully understand why it wants access to your a - -The runtime script permission requested by '<nolink>[OBJECTNAME]</nolink>', an object owned by '[NAME]', isn't recognized by the viewer and can't be granted. - -To grant this permission please update your viewer to the latest version from [DOWNLOADURL]. - confirm -
-