From 1d2b3d3dc93ebe4383f5a91cd2ca20b04bd8eba4 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sun, 28 Apr 2013 03:31:16 +0200 Subject: [PATCH 01/12] Derived classes may access this. --- indra/aistatemachine/aistatemachine.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/aistatemachine/aistatemachine.h b/indra/aistatemachine/aistatemachine.h index 160c6d6eb..9b5b0aab6 100644 --- a/indra/aistatemachine/aistatemachine.h +++ b/indra/aistatemachine/aistatemachine.h @@ -146,12 +146,15 @@ class AIStateMachine : public LLThreadSafeRefCount typedef AIAccessConst multiplex_state_type_crat; typedef AIAccess multiplex_state_type_rat; typedef AIAccess multiplex_state_type_wat; + + protected: // Sub state. AIThreadSafeSimpleDC mSubState; typedef AIAccessConst sub_state_type_crat; typedef AIAccess sub_state_type_rat; typedef AIAccess sub_state_type_wat; + private: // Mutex protecting everything below and making sure only one thread runs the state machine at a time. LLMutex mMultiplexMutex; // Mutex that is locked while calling *_impl() functions and the call back. From 19e16240d477438c8971ad4eae3f212ea174627a Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 29 Apr 2013 16:21:46 +0200 Subject: [PATCH 02/12] Less overshoot in HTTP bandwidth graph for higher values. --- indra/newview/llfloaterstats.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterstats.cpp b/indra/newview/llfloaterstats.cpp index a4311897e..85c4102b4 100644 --- a/indra/newview/llfloaterstats.cpp +++ b/indra/newview/llfloaterstats.cpp @@ -247,7 +247,8 @@ void LLFloaterStats::buildStats() stat_barp = net_statviewp->addStat("HTTP Textures", &(LLViewerStats::getInstance()->mHTTPTextureKBitStat), "DebugStatModeHTTPTexture"); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; - stat_barp->mMaxBar = gSavedSettings.getF32("HTTPThrottleBandwidth") * 2; // Times two because we'll have over shoots. + stat_barp->mMaxBar = gSavedSettings.getF32("HTTPThrottleBandwidth"); + stat_barp->mMaxBar *= llclamp(2.0 - (stat_barp->mMaxBar - 400.f) / 3600.f, 1.0, 2.0); // Allow for overshoot (allow more for low bandwidth values). stat_barp->mTickSpacing = 1.f; while (stat_barp->mTickSpacing < stat_barp->mMaxBar / 8) stat_barp->mTickSpacing *= 2.f; From 2a9c48d8d3bca634867ab6360af6627da4027ca8 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 20:19:38 +0200 Subject: [PATCH 03/12] Add debug function 'is_single_threaded' Usage: AIThreadID foo(AIThreadID::none); ... llassert(is_single_threaded(foo)); ... llassert(is_single_threaded(foo)); ... etc The first call to is_single_threaded(foo) remembers the thread, and after that it is enforced that any call from anywhere that uses foo is done by the same thread. If AIThreadID::none is omitted then the thread is enforced to the thread that creates the AIThreadID. --- indra/llcommon/aithreadid.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/aithreadid.h b/indra/llcommon/aithreadid.h index cc7197b21..6b2c08516 100644 --- a/indra/llcommon/aithreadid.h +++ b/indra/llcommon/aithreadid.h @@ -33,7 +33,7 @@ #include // apr_os_thread_t, apr_os_thread_current(), apr_os_thread_equal(). #include // std::ostream. -#include "llpreprocessor.h" // LL_COMMON_API, LL_COMMON_API_TLS +#include "llpreprocessor.h" // LL_COMMON_API, LL_COMMON_API_TLS, LL_UNLIKELY // Lightweight wrapper around apr_os_thread_t. // This class introduces no extra assembly code after optimization; it's only intend is to provide type-safety. @@ -87,6 +87,16 @@ public: #endif }; +// Debugging function. +inline bool is_single_threaded(AIThreadID& thread_id) +{ + if (LL_UNLIKELY(thread_id.is_no_thread())) + { + thread_id.reset(); + } + return thread_id.equals_current_thread(); +} + // Legacy function. inline bool is_main_thread(void) { From 74023d53035c91dfa631f6fbcc6199ce49a0c8f2 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 20:23:42 +0200 Subject: [PATCH 04/12] Compile fix. Move the destructor (and copy constructor while I was at it) to the .cpp file in order to avoid instantiating the destructor of boost::intrusive_ptr from a header, which would require the class ThreadSafeBufferedCurlEasyRequest to be defined in that header, which is unnecessary. In other words, this avoid the need to include "aicurl.h" in headers using AIPerService[Ptr]. Also fixed indentation of a comment. --- indra/llmessage/aicurlperservice.cpp | 9 +++++++++ indra/llmessage/aicurlperservice.h | 5 ++++- indra/llmessage/aicurlprivate.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index 9e13f98c7..28721c1e9 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -81,6 +81,15 @@ AIPerService::AIPerService(void) : { } +AIPerService::~AIPerService() +{ +} + +// Fake copy constructor. +AIPerService::AIPerService(AIPerService const&) : mHTTPBandwidth(0) +{ +} + // url must be of the form // (see http://www.ietf.org/rfc/rfc3986.txt Appendix A for definitions not given here): // diff --git a/indra/llmessage/aicurlperservice.h b/indra/llmessage/aicurlperservice.h index a64d0d57f..20271aeb3 100644 --- a/indra/llmessage/aicurlperservice.h +++ b/indra/llmessage/aicurlperservice.h @@ -92,6 +92,9 @@ class AIPerService { friend class AIThreadSafeSimpleDC; //threadsafe_PerServiceRequestQueue AIPerService(void); + public: + ~AIPerService(); + public: typedef instance_map_type::iterator iterator; typedef instance_map_type::const_iterator const_iterator; @@ -159,7 +162,7 @@ class AIPerService { private: // Disallow copying. - AIPerService(AIPerService const&) : mHTTPBandwidth(0) { } + AIPerService(AIPerService const&); }; namespace AICurlPrivate { diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index abdc978d4..57e6d9210 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -305,7 +305,7 @@ class CurlEasyRequest : public CurlEasyHandle { AIHTTPTimeoutPolicy const* mTimeoutPolicy; std::string mLowercaseServicename; // Lowercase hostname:port (canonicalized) extracted from the url. - AIPerServicePtr mPerServicePtr; // Pointer to the corresponding AIPerService. + AIPerServicePtr mPerServicePtr; // Pointer to the corresponding AIPerService. LLPointer mTimeout;// Timeout administration object associated with last created CurlSocketInfo. bool mTimeoutIsOrphan; // Set to true when mTimeout is not (yet) associated with a CurlSocketInfo. #if defined(CWDEBUG) || defined(DEBUG_CURLIO) From 3cedc7bb81f72c02b71489cc3fc8c1ffb6992d56 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 20:30:46 +0200 Subject: [PATCH 05/12] Stats floater fix up. Add '(UDP)' after Objects, to show that this is UDP bandwidth. Do not add the received HTTP texture bytes to gTextureList.sTextureBits, making it (and the 'UDP Textures' graph) indeed pure UDP. --- indra/newview/llfloaterstats.cpp | 2 +- indra/newview/lltexturefetch.cpp | 11 ----------- indra/newview/lltexturefetch.h | 2 -- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/indra/newview/llfloaterstats.cpp b/indra/newview/llfloaterstats.cpp index 85c4102b4..342e4fa45 100644 --- a/indra/newview/llfloaterstats.cpp +++ b/indra/newview/llfloaterstats.cpp @@ -263,7 +263,7 @@ void LLFloaterStats::buildStats() stat_barp->mTickSpacing = 128.f; stat_barp->mLabelSpacing = 256.f; - stat_barp = net_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mObjectKBitStat), "DebugStatModeObjects"); + stat_barp = net_statviewp->addStat("Objects (UDP)", &(LLViewerStats::getInstance()->mObjectKBitStat), "DebugStatModeObjects"); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1024.f; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index c7603dc26..a129675fb 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2034,7 +2034,6 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mBadPacketCount(0), mTextureCache(cache), mImageDecodeThread(imagedecodethread), - mHTTPTextureBits(0), mTotalHTTPRequests(0), mQAMode(qa_mode), mTotalCacheReadCount(0U), @@ -2186,7 +2185,6 @@ void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size) { LLMutexLock lock(&mNetworkQueueMutex); mHTTPTextureQueue.erase(id); - mHTTPTextureBits += received_size * 8; // Approximate - does not include header bits } void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) @@ -2399,15 +2397,6 @@ void LLTextureFetch::commonUpdate() //virtual S32 LLTextureFetch::update(F32 max_time_ms) { - { - mNetworkQueueMutex.lock() ; - - gTextureList.sTextureBits += mHTTPTextureBits ; - mHTTPTextureBits = 0 ; - - mNetworkQueueMutex.unlock() ; - } - S32 res = LLWorkerThread::update(max_time_ms); if (!mDebugPause) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index d7cc94dcd..4062c310a 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -163,8 +163,6 @@ private: cancel_queue_t mCancelQueue; LLTextureInfo mTextureInfo; - U32 mHTTPTextureBits; - //debug use U32 mTotalHTTPRequests ; From a1a019d3193def8241641a68d614805af7cea823 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 20:34:01 +0200 Subject: [PATCH 06/12] Don't call LLInventoryModelBackgroundFetch::backgroundFetchCB unnecessarily Remove LLInventoryModelBackgroundFetch::backgroundFetchCB from gIdleCallbacks when we don't need it anymore. --- indra/newview/llinventorymodelbackgroundfetch.cpp | 14 +++++++++----- indra/newview/llinventorymodelbackgroundfetch.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 6b88ab5c5..3fd1b52d2 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -115,7 +115,6 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) { // it's a folder, do a bulk fetch LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL; - mBackgroundFetchActive = TRUE; mFolderFetchActive = true; if (id.isNull()) { @@ -124,12 +123,14 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) mRecursiveInventoryFetchStarted |= recursive; mFetchQueue.push_back(FetchQueueInfo(gInventory.getRootFolderID(), recursive)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mBackgroundFetchActive = TRUE; } if (!mRecursiveLibraryFetchStarted) { mRecursiveLibraryFetchStarted |= recursive; mFetchQueue.push_back(FetchQueueInfo(gInventory.getLibraryRootFolderID(), recursive)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mBackgroundFetchActive = TRUE; } } else @@ -139,6 +140,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) { mFetchQueue.push_front(FetchQueueInfo(id, recursive)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mBackgroundFetchActive = TRUE; } if (id == gInventory.getLibraryRootFolderID()) { @@ -178,6 +180,11 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() mAllFoldersFetched = TRUE; } mFolderFetchActive = false; + if (mBackgroundFetchActive) + { + gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mBackgroundFetchActive = FALSE; + } } void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *) @@ -207,10 +214,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() if (mFetchQueue.empty()) { llinfos << "Inventory fetch completed" << llendl; - setAllFoldersFetched(); - mBackgroundFetchActive = false; - mFolderFetchActive = false; return; } @@ -395,7 +399,6 @@ class LLInventoryModelFetchDescendentsResponder : public LLHTTPClient::Responder mRequestSD(request_sd), mRecursiveCatUUIDs(recursive_cats) {}; - //LLInventoryModelFetchDescendentsResponder() {}; /*virtual*/ void result(const LLSD& content); /*virtual*/ void error(U32 status, const std::string& reason); /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return inventoryModelFetchDescendentsResponder_timeout; } @@ -750,6 +753,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() else if (isBulkFetchProcessingComplete()) { + llinfos << "Inventory fetch completed" << llendl; setAllFoldersFetched(); } } diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index bc40cc5cb..ac4c1a0c0 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -75,7 +75,7 @@ private: BOOL mRecursiveLibraryFetchStarted; BOOL mAllFoldersFetched; - BOOL mBackgroundFetchActive; + BOOL mBackgroundFetchActive; // TRUE if LLInventoryModelBackgroundFetch::backgroundFetchCB is being called from idle(). bool mFolderFetchActive; S16 mFetchCount; BOOL mTimelyFetchPending; From 0c7e62ab5995a69cf59e29ab1ad314ead8975565 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 20:36:00 +0200 Subject: [PATCH 07/12] Add throttling to HTTP inventory (bulk) fetching. Call AIPerService::wantsMoreHTTPRequestsFor in LLInventoryModelBackgroundFetch::bulkFetch to determine if curl is ready for the next batch or not, instead of using inaccurate heuristic code that is just guessing a bit. --- .../llinventorymodelbackgroundfetch.cpp | 31 ++++++++++--------- .../newview/llinventorymodelbackgroundfetch.h | 3 ++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 3fd1b52d2..a481a6720 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -37,6 +37,7 @@ #include "llviewermessage.h" #include "llviewerregion.h" #include "llviewerwindow.h" +#include "hippogridmanager.h" class AIHTTPTimeoutPolicy; extern AIHTTPTimeoutPolicy inventoryModelFetchDescendentsResponder_timeout; @@ -201,10 +202,20 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() std::string url = region->getCapability("FetchInventory2"); if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) { + if (!mPerServicePtr) + { + // One time initialization needed for bulkFetch(). + std::string servicename = AIPerService::extract_canonical_servicename(url); + if (!servicename.empty()) + { + llinfos << "Initialized service name for bulk inventory fetching with \"" << servicename << "\"." << llendl; + mPerServicePtr = AIPerService::instance(servicename); + } + } bulkFetch(); return; } - + #if 1 //-------------------------------------------------------------------------------- // DEPRECATED OLD CODE @@ -578,28 +589,20 @@ BOOL LLInventoryModelFetchDescendentsResponder::getIsRecursive(const LLUUID& cat } // Bundle up a bunch of requests to send all at once. -// static void LLInventoryModelBackgroundFetch::bulkFetch() { //Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped. //If there are items in mFetchQueue, we want to check the time since the last bulkFetch was //sent. If it exceeds our retry time, go ahead and fire off another batch. LLViewerRegion* region = gAgent.getRegion(); - if (!region) return; + if (gDisconnected || !region) return; - S16 max_concurrent_fetches=8; - F32 new_min_time = 0.5f; //HACK! Clean this up when old code goes away entirely. - if (mMinTimeBetweenFetches < new_min_time) + static LLCachedControl const throttle_bandwidth("HTTPThrottleBandwidth", 2000); + bool const no_bandwidth_throttling = gHippoGridManager->getConnectedGrid()->isAvination(); + if (!AIPerService::wantsMoreHTTPRequestsFor(mPerServicePtr, throttle_bandwidth, no_bandwidth_throttling)) { - mMinTimeBetweenFetches=new_min_time; //HACK! See above. + return; // Wait. } - - if (gDisconnected || - (mFetchCount > max_concurrent_fetches) || - (mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches)) - { - return; // just bail if we are disconnected - } U32 item_count=0; U32 folder_count=0; diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index ac4c1a0c0..4056bdfbd 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -29,6 +29,7 @@ #include "llsingleton.h" #include "lluuid.h" +#include "aicurlperservice.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryModelBackgroundFetch @@ -81,6 +82,8 @@ private: BOOL mTimelyFetchPending; S32 mNumFetchRetries; + AIPerServicePtr mPerServicePtr; // Pointer to the AIPerService corresponding to the FetchInventory2 capability. + LLFrameTimer mFetchTimer; F32 mMinTimeBetweenFetches; F32 mMaxTimeBetweenFetches; From 873b61c39dcc993904b0f369e82d0618967495a7 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 22:16:29 +0200 Subject: [PATCH 08/12] Fix comment. --- indra/llmessage/aicurlthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 47a4d6d59..8b4f1a022 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -2624,7 +2624,7 @@ bool AIPerService::wantsMoreHTTPRequestsFor(AIPerServicePtr const& per_service, } } - // Check if it's ok to get a new request for this particular host and update the per-host threshold. + // Check if it's ok to get a new request for this particular service and update the per-service threshold. AIAverage* http_bandwidth_ptr; From 13e246611d155603539e51231e10bcf354ec9bd4 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 30 Apr 2013 22:48:32 +0200 Subject: [PATCH 09/12] Make refresh_desktop_app_entry.sh executable. --- indra/newview/linux_tools/refresh_desktop_app_entry.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/linux_tools/refresh_desktop_app_entry.sh diff --git a/indra/newview/linux_tools/refresh_desktop_app_entry.sh b/indra/newview/linux_tools/refresh_desktop_app_entry.sh old mode 100644 new mode 100755 From 673e96e8298f68a59bd48286cc507348ae5c7f56 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 3 May 2013 00:06:32 +0200 Subject: [PATCH 10/12] Linux script fix at exit viewer. --- indra/newview/linux_tools/wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index ff7fc48ae..d73fbc766 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -154,7 +154,7 @@ export SL_OPT="`cat gridargs.dat` $@" eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr # Handle any resulting errors -if [ -n "$LL_RUN_ERR" = "runerr" ]; then +if [ -n "$LL_RUN_ERR" ]; then # generic error running the binary echo '*** Bad shutdown. ***' fi From 4983fd6ab6ddf0d03f415e84c185ad8f1350ef37 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 3 May 2013 17:59:27 +0200 Subject: [PATCH 11/12] Allow switching between HTTP and UDP inventory without relogging. This also makes the viewer immune for grids that send the FetchInventory2 et al capabilities regardsless of whether we requested them (in fact, we always request them now: we need them when someone switches in the middle of a session). Note that (I tested that) textures could already be switched between HTTP and UDP without relogging. --- .../llinventorymodelbackgroundfetch.cpp | 41 ++++++++----------- indra/newview/lltexturefetch.cpp | 2 +- indra/newview/llviewerinventory.cpp | 33 ++++++++------- indra/newview/llviewerregion.cpp | 13 ++---- 4 files changed, 40 insertions(+), 49 deletions(-) diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index a481a6720..272a0aad8 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -198,23 +198,26 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() LLViewerRegion* region = gAgent.getRegion(); if (mBackgroundFetchActive && region && region->capabilitiesReceived()) { - // If we'll be using the capability, we'll be sending batches and the background thing isn't as important. - std::string url = region->getCapability("FetchInventory2"); - if (gSavedSettings.getBOOL("UseHTTPInventory") && !url.empty()) + if (gSavedSettings.getBOOL("UseHTTPInventory")) { - if (!mPerServicePtr) + // If we'll be using the capability, we'll be sending batches and the background thing isn't as important. + std::string url = region->getCapability("FetchInventory2"); + if (!url.empty()) { - // One time initialization needed for bulkFetch(). - std::string servicename = AIPerService::extract_canonical_servicename(url); - if (!servicename.empty()) + if (!mPerServicePtr) { - llinfos << "Initialized service name for bulk inventory fetching with \"" << servicename << "\"." << llendl; - mPerServicePtr = AIPerService::instance(servicename); + // One time initialization needed for bulkFetch(). + std::string servicename = AIPerService::extract_canonical_servicename(url); + if (!servicename.empty()) + { + llinfos << "Initialized service name for bulk inventory fetching with \"" << servicename << "\"." << llendl; + mPerServicePtr = AIPerService::instance(servicename); + } } + bulkFetch(); + return; } - bulkFetch(); - return; - } + } #if 1 //-------------------------------------------------------------------------------- @@ -714,6 +717,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() { mFetchCount++; url = region->getCapability("FetchInventory2"); + llassert(!url.empty()); if (!url.empty()) { LLSD body; @@ -722,18 +726,6 @@ void LLInventoryModelBackgroundFetch::bulkFetch() LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body)); } - //else - //{ - // LLMessageSystem* msg = gMessageSystem; - // msg->newMessage("FetchInventory"); - // msg->nextBlock("AgentData"); - // msg->addUUID("AgentID", gAgent.getID()); - // msg->addUUID("SessionID", gAgent.getSessionID()); - // msg->nextBlock("InventoryData"); - // msg->addUUID("OwnerID", mPermissions.getOwner()); - // msg->addUUID("ItemID", mUUID); - // gAgent.sendReliableMessage(); - //} } if (item_request_body_lib.size()) @@ -741,6 +733,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() mFetchCount++; url = region->getCapability("FetchLib2"); + llassert(!url.empty()); if (!url.empty()) { LLSD body; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index a129675fb..f80bd9539 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1172,7 +1172,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { - // This will happen if not logged in or if a region deoes not have HTTP Texture enabled + // This will happen if not logged in or if a region does not have HTTP Texture enabled //llwarns << "Region not found for host: " << mHost << llendl; mCanUseHTTP = false; } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index eb3e35997..97ea6d71a 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -353,22 +353,25 @@ void LLViewerInventoryItem::fetchFromServer(void) const { std::string url; - LLViewerRegion* region = gAgent.getRegion(); - // we have to check region. It can be null after region was destroyed. See EXT-245 - if (region) + if (gSavedSettings.getBOOL("UseHTTPInventory")) { - if(gAgent.getID() != mPermissions.getOwner()) - { - url = region->getCapability("FetchLib2"); - } - else - { - url = region->getCapability("FetchInventory2"); - } - } - else - { - llwarns << "Agent Region is absent" << llendl; + LLViewerRegion* region = gAgent.getRegion(); + // we have to check region. It can be null after region was destroyed. See EXT-245 + if (region) + { + if(gAgent.getID() != mPermissions.getOwner()) + { + url = region->getCapability("FetchLib2"); + } + else + { + url = region->getCapability("FetchInventory2"); + } + } + else + { + llwarns << "Agent Region is absent" << llendl; + } } if (!url.empty()) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 70f432f02..6c09d31e4 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1638,15 +1638,10 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("EnvironmentSettings"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); - - if (gSavedSettings.getBOOL("UseHTTPInventory")) //Caps suffixed with 2 by LL. Don't update until rest of fetch system is updated first. - { - capabilityNames.append("FetchLib2"); - capabilityNames.append("FetchLibDescendents2"); - capabilityNames.append("FetchInventory2"); - capabilityNames.append("FetchInventoryDescendents2"); - } - + capabilityNames.append("FetchLib2"); + capabilityNames.append("FetchLibDescendents2"); + capabilityNames.append("FetchInventory2"); + capabilityNames.append("FetchInventoryDescendents2"); capabilityNames.append("GamingData"); //Used by certain grids. capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetMesh"); From 4cc42cd5bd9b03eebc052ffe055e440dfe9a3aeb Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 3 May 2013 19:05:31 +0200 Subject: [PATCH 12/12] Fix for file-5.14 --- indra/newview/linux_tools/wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d73fbc766..0806df29d 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -141,7 +141,7 @@ if [ -n "$LL_TCMALLOC" ]; then fi export VIEWER_BINARY='singularity-do-not-run-directly' -BINARY_TYPE=$(expr match "$(file -b bin/$VIEWER_BINARY)" '\(.*executable\)') +BINARY_TYPE=$(expr match "$(file -b bin/$VIEWER_BINARY)" '\(.*executable\)' | sed -e 's/ / /g') if [ "${BINARY_TYPE}" == "ELF 64-bit LSB executable" ]; then SL_ENV+='LD_LIBRARY_PATH="`pwd`/lib64:`pwd`/lib32:$LD_LIBRARY_PATH"' else