From f2a22123b007531e1e4ef38e8fadeb9779dba4c2 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 3 Jun 2018 13:49:25 +0200 Subject: [PATCH 01/14] Add fast timer for growl notifications for diagnostics --- indra/newview/growlmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index 05cfbd4f20..07849ba210 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -218,6 +218,7 @@ void GrowlManager::loadConfig() } +static LLTrace::BlockTimerStatHandle FTM_GROWL_NOTIFY("Growl Notify"); void GrowlManager::performNotification(const std::string& title, const std::string& message, const std::string& type) { if (LLAppViewer::instance()->isExiting()) @@ -250,7 +251,11 @@ void GrowlManager::performNotification(const std::string& title, const std::stri } mTitleTimers[title] = now; } - mNotifier->showNotification(title, message.substr(0, GROWL_MAX_BODY_LENGTH), type); + + { + LL_RECORD_BLOCK_TIME(FTM_GROWL_NOTIFY); + mNotifier->showNotification(title, message.substr(0, GROWL_MAX_BODY_LENGTH), type); + } } BOOL GrowlManager::tick() From 01422078e9e0dd179911d6885c9d7bcb99d0a627 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 3 Jun 2018 15:00:32 +0200 Subject: [PATCH 02/14] Fix name tags and voice indicators becoming invisible when selecting mesh --- indra/newview/lldrawpool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 82888b2df6..0ed91e91a8 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -506,7 +506,8 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba params.mGroup->rebuildMesh(); } - LLGLEnableFunc stencil_test(GL_STENCIL_TEST, params.mSelected, &LLGLCommonFunc::selected_stencil_test); + // Enabling stencil test here will cull name tags and voice indicator when selecting mesh + //LLGLEnableFunc stencil_test(GL_STENCIL_TEST, params.mSelected, &LLGLCommonFunc::selected_stencil_test); params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); From 6c6d021ca0d6bf9fec7b0cadb1b501f8538c3c63 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 3 Jun 2018 16:20:44 +0200 Subject: [PATCH 03/14] Undo previous change --- indra/newview/lldrawpool.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 0ed91e91a8..82888b2df6 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -506,8 +506,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba params.mGroup->rebuildMesh(); } - // Enabling stencil test here will cull name tags and voice indicator when selecting mesh - //LLGLEnableFunc stencil_test(GL_STENCIL_TEST, params.mSelected, &LLGLCommonFunc::selected_stencil_test); + LLGLEnableFunc stencil_test(GL_STENCIL_TEST, params.mSelected, &LLGLCommonFunc::selected_stencil_test); params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); From 1d6fdc9356b67f3b99379d5b31d2dd5d72a619fb Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 3 Jun 2018 16:25:37 +0200 Subject: [PATCH 04/14] Disable stencil test for various HUD-related render operations --- indra/newview/llhudeffectlookat.cpp | 2 ++ indra/newview/llhudeffectpointat.cpp | 1 + indra/newview/llhudicon.cpp | 1 + indra/newview/llhudnametag.cpp | 1 + indra/newview/llhudtext.cpp | 1 + indra/newview/llvoicevisualizer.cpp | 1 + 6 files changed, 7 insertions(+) diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index be3efc1969..3c29239e30 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -564,6 +564,8 @@ void LLHUDEffectLookAt::render() if ((hide_own || is_private) && ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->isSelf()) return; + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining + LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition(); LLColor3 lookAtColor = (*mAttentions)[mTargetType].mColor; diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 7c3af0dd1b..3829e1c205 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -346,6 +346,7 @@ void LLHUDEffectPointAt::render() update(); if (sDebugPointAt && mTargetType != POINTAT_TARGET_NONE) { + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLVector3 target = mTargetPos + mSourceObject->getRenderPosition(); diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index c546ae316b..2ba5c5849d 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -85,6 +85,7 @@ void LLHUDIcon::renderIcon(BOOL for_select) { LLGLSUIDefault texture_state; LLGLDepthTest gls_depth(GL_TRUE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining if (for_select) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 3a86b55211..d806f1a7d1 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -229,6 +229,7 @@ void LLHUDNameTag::render() if (sDisplayText) { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining renderText(FALSE); } } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 9025736657..817fcfc818 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -109,6 +109,7 @@ void LLHUDText::render() if (!mOnHUDAttachment && sDisplayText) { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining renderText(); } } diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index cb83cf8fdf..62493cdadd 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -356,6 +356,7 @@ void LLVoiceVisualizer::render() //--------------------------------------------------------------- LLGLSPipelineAlpha alpha_blend; LLGLDepthTest depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); // HUD items hidden by new mesh selection outlining //------------------------------------------------------------- // create coordinates of the geometry for the dot From 18cc3b1793b716b0f8919681e06ca0f7181079cc Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Wed, 6 Jun 2018 09:35:06 +0200 Subject: [PATCH 05/14] Updated Polish translation --- indra/newview/skins/default/xui/pl/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index 662ab79b99..17877ca671 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -5611,6 +5611,9 @@ Spróbuj załączyć ścieżkę do edytora w cytowaniu. wyłączone + + (wyłączone) + [Użytkownika] From 35cd8e25ef5f9d7387142326a898a933f1415636 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 6 Jun 2018 11:04:22 +0200 Subject: [PATCH 06/14] FIRE-22625 Restrict stream info announce channel to 16777216 --- indra/newview/skins/default/xui/en/panel_preferences_sound.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index 77a1a89ecd..882939053e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -724,7 +724,7 @@ left_pad="5" increment="1" initial_value="362394" - max_val="2147483647" + max_val="16777216" min_val="1" name="StreamMetadataAnnounceChannel" width="90" /> From 14ae6fb37c483e1445b36710b7a264c74f3ece92 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 10 Jun 2018 02:36:29 +0200 Subject: [PATCH 07/14] FIRE-13930: Show Growl notification when receiving TP offers/requests --- .../app_settings/growl_notifications.xml | 63 +++++++++++++++++++ indra/newview/growlmanager.cpp | 3 +- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/growl_notifications.xml b/indra/newview/app_settings/growl_notifications.xml index 26067419f9..c8e147dc98 100644 --- a/indra/newview/app_settings/growl_notifications.xml +++ b/indra/newview/app_settings/growl_notifications.xml @@ -191,5 +191,68 @@ GrowlBody [MESSAGE] + TeleportOffered + + GrowlName + Teleport offer received + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportOffered_MaturityExceeded + + GrowlName + Teleport offer received (Maturity exceeded) + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportOffered_MaturityBlocked + + GrowlName + Teleport offer received (Maturity blocked) + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportOffered_SLUrl + + GrowlName + Teleport offer received (SLUrl) + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportOffered_MaturityExceeded_SLUrl + + GrowlName + Teleport offer received (SLURL, Maturity exceeded) + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportOffered_MaturityBlocked_SLUrl + + GrowlName + Teleport offer received (SLUrl, Maturity blocked) + GrowlTitle + Teleport offer received + GrowlBody + [NAME_SLURL] has offered to teleport you to their location: [MESSAGE] + + TeleportRequest + + GrowlName + Teleport request received + GrowlTitle + Teleport request received + GrowlBody + [NAME_SLURL] is requesting to be teleported to your location: [MESSAGE] + diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index 07849ba210..b117a22e9f 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -298,7 +298,8 @@ bool GrowlManager::onLLNotification(const LLSD& notice) LLStringUtil::format(body, substitutions); } - if (name == "ObjectGiveItem" || name == "OwnObjectGiveItem" || name == "ObjectGiveItemUnknownUser" || name == "UserGiveItem" || name == "SystemMessageTip") + if (name == "ObjectGiveItem" || name == "OwnObjectGiveItem" || name == "ObjectGiveItemUnknownUser" || name == "UserGiveItem" || name == "SystemMessageTip" + || LLStringUtil::startsWith(name, "TeleportOffered") || name == "TeleportRequest") { LLUrlMatch urlMatch; LLWString newLine = utf8str_to_wstring(body); From 5528b2863a48f93dc440b657683d949ce802a98c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 10 Jun 2018 13:23:51 +0200 Subject: [PATCH 08/14] Prevent saving duplicate music URLs --- indra/newview/llpanellandaudio.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index 4f2c40bf90..e76543a585 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -256,10 +256,24 @@ void LLPanelLandAudio::onBtnStreamAdd() if (!music_url.empty()) { LLSD streamlist = gSavedSettings.getLLSD("FSStreamList"); - streamlist["version"] = 1; - streamlist["audio"].append(music_url); - gSavedSettings.setLLSD("FSStreamList", streamlist); - refresh(); + + bool has_url = false; + for (LLSD::array_const_iterator it = streamlist["audio"].beginArray(); it != streamlist["audio"].endArray(); ++it) + { + if ((*it).asString() == music_url) + { + has_url = true; + break; + } + } + + if (!has_url) + { + streamlist["version"] = 1; + streamlist["audio"].append(music_url); + gSavedSettings.setLLSD("FSStreamList", streamlist); + refresh(); + } } } From 34926d06f3398e31f1c58c1e731bf9f721ff2d6e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 11 Jun 2018 00:57:37 +0200 Subject: [PATCH 09/14] Crash fix in process_agent_movement_complete() --- indra/newview/llviewermessage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 091231ab56..e0207b6ea0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3521,6 +3521,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } + // Crash fix + if (!gAgent.getRegion()) + { + LL_WARNS("Messaging") << "Agent was disconnected from the region" << LL_ENDL; + LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected")); + return; + } + // + LL_INFOS("Messaging") << "Changing home region to " << x << ":" << y << LL_ENDL; // set our upstream host the new simulator and shuffle things as From 4b31a9896d80eefc5737f01bf395585f1b419012 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 11 Jun 2018 18:24:48 +0200 Subject: [PATCH 10/14] Add some more logging to bridge creation --- indra/newview/fslslbridge.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index 296967ca62..aa0e55134e 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -1153,7 +1153,7 @@ FSLSLBridgeScriptCallback::~FSLSLBridgeScriptCallback() class FSMonoScriptAssetUpload: public LLScriptAssetUpload { public: - FSMonoScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish) + FSMonoScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish) : LLScriptAssetUpload( itemId, buffer, finish) { } @@ -1207,12 +1207,12 @@ void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item) bool cleanup = false; if (!url.empty() && obj) { - std::string buffer; + std::string buffer; const std::string fName = prepUploadFile(buffer); if (!fName.empty()) { - LLResourceUploadInfo::ptr_t uploadInfo(new FSMonoScriptAssetUpload( inv_item, buffer, uploadDone )); - LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); + LLResourceUploadInfo::ptr_t uploadInfo(new FSMonoScriptAssetUpload( inv_item, buffer, uploadDone )); + LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); LL_INFOS("FSLSLBridge") << "updating script ID for bridge" << LL_ENDL; FSLSLBridge::instance().mScriptItemID = inv_item; @@ -1330,8 +1330,8 @@ void FSLSLBridge::checkBridgeScriptName() BOOL FSLSLBridgeCleanupTimer::tick() { - FSLSLBridge::instance().finishBridge(); stopTimer(); + FSLSLBridge::instance().finishBridge(); return TRUE; } @@ -1360,18 +1360,21 @@ void FSLSLBridge::finishBridge() mIsFirstCallDone = false; cleanUpOldVersions(); cleanUpBridgeFolder(); - LL_INFOS("FSLSLBridge") << "Bridge cleaned up. Detaching bridge" << LL_ENDL; + LL_INFOS("FSLSLBridge") << "Bridge cleaned up" << LL_ENDL; mAllowDetach = true; mFinishCreation = true; if (getBridge()) { + LL_INFOS("FSLSLBridge") << "Detaching bridge after cleanup" << LL_ENDL; LLVOAvatarSelf::detachAttachmentIntoInventory(getBridge()->getUUID()); } else { LL_WARNS("FSLSLBridge") << "Cannot detach bridge - mpBridge = NULL" << LL_ENDL; } + + LL_INFOS("FSLSLBridge") << "End finishing bridge" << LL_ENDL; } // @@ -1589,6 +1592,7 @@ void FSLSLBridge::detachOtherBridges() BOOL FSLSLBridgeReAttachTimer::tick() { LL_INFOS("FSLSLBridge") << "Re-attaching bridge after creation..." << LL_ENDL; + mEventTimer.stop(); LLViewerInventoryItem* inv_object = gInventory.getItem(mBridgeUUID); if (inv_object && FSLSLBridge::instance().mpBridge && FSLSLBridge::instance().mpBridge->getUUID() == inv_object->getUUID()) { From c3e588c228d3a586a321e6cc78ed57c03e325335 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 11 Jun 2018 18:32:24 +0200 Subject: [PATCH 11/14] Pull fixes for Mac OSX 10.14 --- indra/llcommon/llerror.cpp | 24 +++++++----------------- indra/llui/llscrolllistctrl.cpp | 1 - 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index c72b74f611..720faeda39 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -257,23 +257,13 @@ namespace LLError { #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle - - static size_t abi_name_len = 100; - static char* abi_name_buf = (char*)malloc(abi_name_len); - // warning: above is voodoo inferred from the GCC manual, - // do NOT change - - int status; - // We don't use status, and shouldn't have to pass apointer to it - // but gcc 3.3 libstc++'s implementation of demangling is broken - // and fails without. - - char* name = abi::__cxa_demangle(mangled, - abi_name_buf, &abi_name_len, &status); - // this call can realloc the abi_name_buf pointer (!) - - return name ? name : mangled; - + // passing nullptr, 0 forces allocation of a unique buffer we can free + // fixing MAINT-8724 on OSX 10.14 + int status = -1; + char* name = abi::__cxa_demangle(mangled, nullptr, 0, &status); + std::string result(name ? name : mangled); + free(name); + return result; #elif LL_WINDOWS // DevStudio: type_info::name() includes the text "class " at the start diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index e6a2468e03..7e99a4b4c8 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -3080,7 +3080,6 @@ void LLScrollListCtrl::onClickColumn(void *userdata) } // if this column is the primary sort key, reverse the direction - sort_column_t cur_sort_column; if (!parent->mSortColumns.empty() && parent->mSortColumns.back().first == column_index) { ascending = !parent->mSortColumns.back().second; From d32de5eeee0c2ed14fdf6a9520dc4b9f4af6d036 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 13 Jun 2018 17:04:38 +0200 Subject: [PATCH 12/14] Fix a few FSData related issues: * Use raw GET to prevent the HttpCoroHandler try to parse status 404 response bodies and complaining about invalid LLSD * No need to check for status 304 response in downloadComplete() - 304 will result in failure callback being invoked * Distinguish between status 304 (not modified) and other download failures * Fix http_result node being written to grids.remote.xml file at startup --- indra/newview/fsdata.cpp | 122 +++++++++++++++++++++++------------- indra/newview/fsdata.h | 2 +- indra/newview/llstartup.cpp | 14 ++++- 3 files changed, 92 insertions(+), 46 deletions(-) diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 76d87ac197..dcd4c4c65c 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -105,7 +105,7 @@ void FSData::processResponder(const LLSD& content, const std::string& url, bool if (!save_to_file) { LLSD data; - LL_DEBUGS("fsdata") << "Loading fsdata.xml from " << mFSdataFilename << LL_ENDL; + LL_DEBUGS("fsdata") << "Loading fsdata.xml from " << mFSdataFilename << LL_ENDL; if (loadFromFile(data, mFSdataFilename)) { processData(data); @@ -127,8 +127,8 @@ void FSData::processResponder(const LLSD& content, const std::string& url, bool if (!save_to_file) { LLSD data; - LL_DEBUGS("fsdata") << "Loading assets.xml from " << mAssestsFilename << LL_ENDL; - if (loadFromFile(data, mAssestsFilename)) + LL_DEBUGS("fsdata") << "Loading assets.xml from " << mAssetsFilename << LL_ENDL; + if (loadFromFile(data, mAssetsFilename)) { processAssets(data); } @@ -140,7 +140,7 @@ void FSData::processResponder(const LLSD& content, const std::string& url, bool else { processAssets(content); - saveLLSD(content, mAssestsFilename, last_modified); + saveLLSD(content, mAssetsFilename, last_modified); } } else if (url == mAgentsURL) @@ -217,27 +217,39 @@ bool FSData::loadFromFile(LLSD& data, std::string filename) void downloadComplete(LLSD const &aData, std::string const &aURL, bool success) { - LL_DEBUGS("fsdata") << aData << LL_ENDL; + LL_DEBUGS("fsdata") << aURL << ": " << aData << " - success = " << success << LL_ENDL; - LLSD header = aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS][LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS]; - LLDate lastModified; - if (header.has("last-modified")) + LLSD data; + if (success) { - lastModified.secondsSinceEpoch(FSCommon::secondsSinceEpochFromString("%a, %d %b %Y %H:%M:%S %ZP", header["last-modified"].asString())); + LLSD header = aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS][LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS]; + if (header.has("last-modified")) + { + lastModified.secondsSinceEpoch(FSCommon::secondsSinceEpochFromString("%a, %d %b %Y %H:%M:%S %ZP", header["last-modified"].asString())); + } + + const LLSD::Binary& binary = aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary(); + std::string content; + content.assign(binary.begin(), binary.end()); + std::istringstream raw(content); + + LLPointer parser = new LLSDXMLParser(); + if (parser->parse(raw, data, content.size()) == LLSDParser::PARSE_FAILURE) + { + LL_WARNS("fsdata") << "Error parsing data received from " << aURL << ":" << LL_NEWLINE << content << LL_ENDL; + } + + LL_DEBUGS("fsdata") << "data: " << data << LL_ENDL; } - LLSD data = aData; - data.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); - FSData::getInstance()->processResponder(data, aURL, success, lastModified); } void downloadCompleteScript(LLSD const &aData, std::string const &aURL, std::string const &aFilename) { - LL_DEBUGS("fsdata") << aData << LL_ENDL; + LL_DEBUGS("fsdata") << aURL << ": " << aData << LL_ENDL; LLSD header = aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS][LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]); LLDate lastModified; if (header.has("last-modified")) @@ -246,12 +258,6 @@ void downloadCompleteScript(LLSD const &aData, std::string const &aURL, std::str } const LLSD::Binary &rawData = aData[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary(); - if (status.getType() == HTTP_NOT_MODIFIED) - { - LL_INFOS("fsdata") << "Got [304] not modified for " << aURL << LL_ENDL; - return; - } - if (rawData.size() <= 0) { LL_WARNS("fsdata") << "Received zero data for " << aURL << LL_ENDL; @@ -284,7 +290,16 @@ void downloadCompleteScript(LLSD const &aData, std::string const &aURL, std::str void downloadError(LLSD const &aData, std::string const &aURL) { - LL_WARNS("fsdata") << "Failed to download " << aURL << ": " << aData << LL_ENDL; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(aData); + + if (status.getType() == HTTP_NOT_MODIFIED) + { + LL_INFOS("fsdata") << "Didn't download " << aURL << " - no newer version available" << LL_ENDL; + } + else + { + LL_WARNS("fsdata") << "Failed to download " << aURL << ": " << aData << LL_ENDL; + } } // call this just before the login screen and after the LLProxy has been setup. @@ -294,32 +309,44 @@ void FSData::startDownload() mFSdataDefaultsFilename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "fsdata_defaults.xml"); mClientTagsFilename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "client_list_v2.xml"); - // Stat the file to see if it exists and when it was last modified. - time_t last_modified = 0; - llstat stat_data; - if (!LLFile::stat(mFSdataFilename, &stat_data)) { - last_modified = stat_data.st_mtime; + // Stat the file to see if it exists and when it was last modified. + time_t last_modified = 0; + llstat stat_data; + if (!LLFile::stat(mFSdataFilename, &stat_data)) + { + last_modified = stat_data.st_mtime; + } + LL_INFOS("fsdata") << "Downloading data.xml from " << mFSDataURL << " with last modified of " << last_modified << LL_ENDL; + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); + FSCoreHttpUtil::callbackHttpGetRaw(mFSDataURL, boost::bind(downloadComplete, _1, mFSDataURL, true), boost::bind(downloadComplete, _1, mFSDataURL, false), LLCore::HttpHeaders::ptr_t(), httpOpts); } - LL_INFOS("fsdata") << "Downloading data.xml from " << mFSDataURL << " with last modified of " << last_modified << LL_ENDL; - FSCoreHttpUtil::callbackHttpGet(mFSDataURL, last_modified, boost::bind(downloadComplete, _1, mFSDataURL, true), boost::bind(downloadComplete, _1, mFSDataURL, false)); - last_modified = 0; - if (!LLFile::stat(mFSdataDefaultsFilename, &stat_data)) { - last_modified = stat_data.st_mtime; + time_t last_modified = 0; + llstat stat_data; + if (!LLFile::stat(mFSdataDefaultsFilename, &stat_data)) + { + last_modified = stat_data.st_mtime; + } + std::string filename = llformat("defaults.%s.xml", LLVersionInfo::getShortVersion().c_str()); + mFSdataDefaultsUrl = mBaseURL + "/" + filename; + LL_INFOS("fsdata") << "Downloading defaults.xml from " << mFSdataDefaultsUrl << " with last modified of " << last_modified << LL_ENDL; + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); + FSCoreHttpUtil::callbackHttpGetRaw(mFSdataDefaultsUrl, boost::bind(downloadComplete, _1, mFSdataDefaultsUrl, true), boost::bind(downloadComplete, _1, mFSdataDefaultsUrl, false), LLCore::HttpHeaders::ptr_t(), httpOpts); } - std::string filename = llformat("defaults.%s.xml", LLVersionInfo::getShortVersion().c_str()); - mFSdataDefaultsUrl = mBaseURL + "/" + filename; - LL_INFOS("fsdata") << "Downloading defaults.xml from " << mFSdataDefaultsUrl << " with last modified of " << last_modified << LL_ENDL; - FSCoreHttpUtil::callbackHttpGet(mFSdataDefaultsUrl, last_modified, boost::bind(downloadComplete, _1, mFSdataDefaultsUrl, true), boost::bind(downloadComplete, _1, mFSdataDefaultsUrl, false)); #if OPENSIM std::string filenames[] = {"scriptlibrary_ossl.xml", "scriptlibrary_aa.xml"}; BOOST_FOREACH(std::string script_name, filenames) { - filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, script_name); - last_modified = 0; + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, script_name); + time_t last_modified = 0; + llstat stat_data; if (!LLFile::stat(filename, &stat_data)) { last_modified = stat_data.st_mtime; @@ -370,20 +397,26 @@ void FSData::downloadAgents() last_modified = stat_data.st_mtime; } LL_INFOS("fsdata") << "Downloading agents.xml from " << mAgentsURL << " with last modified of " << last_modified << LL_ENDL; - FSCoreHttpUtil::callbackHttpGet(mAgentsURL, last_modified, boost::bind(downloadComplete, _1, mAgentsURL, true), boost::bind(downloadComplete, _1, mAgentsURL, false)); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); + FSCoreHttpUtil::callbackHttpGetRaw(mAgentsURL, boost::bind(downloadComplete, _1, mAgentsURL, true), boost::bind(downloadComplete, _1, mAgentsURL, false), LLCore::HttpHeaders::ptr_t(), httpOpts); } if (!mAssetsURL.empty()) { - mAssestsFilename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename_prefix + "_assets.xml"); + mAssetsFilename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename_prefix + "_assets.xml"); time_t last_modified = 0; llstat stat_data; - if (!LLFile::stat(mAssestsFilename, &stat_data)) + if (!LLFile::stat(mAssetsFilename, &stat_data)) { last_modified = stat_data.st_mtime; } LL_INFOS("fsdata") << "Downloading assets.xml from " << mAssetsURL << " with last modified of " << last_modified << LL_ENDL; - FSCoreHttpUtil::callbackHttpGet(mAssetsURL, last_modified, boost::bind(downloadComplete, _1, mAssetsURL, true), boost::bind(downloadComplete, _1, mAssetsURL, false)); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); + FSCoreHttpUtil::callbackHttpGetRaw(mAssetsURL, boost::bind(downloadComplete, _1, mAssetsURL, true), boost::bind(downloadComplete, _1, mAssetsURL, false), LLCore::HttpHeaders::ptr_t(), httpOpts); } } @@ -451,7 +484,10 @@ void FSData::processData(const LLSD& fs_data) last_modified = stat_data.st_mtime; } LL_INFOS("fsdata") << "Downloading client_list_v2.xml from " << LEGACY_CLIENT_LIST_URL << " with last modified of " << last_modified << LL_ENDL; - FSCoreHttpUtil::callbackHttpGet(LEGACY_CLIENT_LIST_URL, last_modified, boost::bind(downloadComplete, _1, LEGACY_CLIENT_LIST_URL, true), boost::bind(downloadComplete, _1, LEGACY_CLIENT_LIST_URL, false)); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); + FSCoreHttpUtil::callbackHttpGetRaw(LEGACY_CLIENT_LIST_URL, boost::bind(downloadComplete, _1, LEGACY_CLIENT_LIST_URL, true), boost::bind(downloadComplete, _1, LEGACY_CLIENT_LIST_URL, false), LLCore::HttpHeaders::ptr_t(), httpOpts); } else if (use_legacy_tags) { @@ -547,7 +583,7 @@ void FSData::processAgents(const LLSD& data) void FSData::processClientTags(const LLSD& tags) { - if(tags.has("isComplete")) + if (tags.has("isComplete")) { mLegacyClientList = tags; } diff --git a/indra/newview/fsdata.h b/indra/newview/fsdata.h index 8358a1a929..769aa4203e 100644 --- a/indra/newview/fsdata.h +++ b/indra/newview/fsdata.h @@ -107,7 +107,7 @@ private: std::string mFSdataDefaultsFilename; std::string mFSdataDefaultsUrl; std::string mAgentsFilename; - std::string mAssestsFilename; + std::string mAssetsFilename; std::string mClientTagsFilename; std::string mBaseURL; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2a09fe100a..081bff6250 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -370,7 +370,7 @@ void downloadGridlistComplete( LLSD const &aData ) llofstream out_file; out_file.open(filename.c_str()); - LLSDSerialize::toPrettyXML( aData, out_file); + LLSDSerialize::toPrettyXML( data, out_file); out_file.close(); LL_INFOS() << "GridListRequest: got new list." << LL_ENDL; sGridListRequestReady = true; @@ -378,7 +378,17 @@ void downloadGridlistComplete( LLSD const &aData ) void downloadGridlistError( LLSD const &aData, std::string const &aURL ) { - LL_WARNS() << "Failed to download grid list from " << aURL << LL_ENDL; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(aData); + + if (status.getType() == HTTP_NOT_MODIFIED) + { + LL_INFOS("fsdata") << "Didn't download grid list from " << aURL << " - no newer version available" << LL_ENDL; + } + else + { + LL_WARNS() << "Failed to download grid list from " << aURL << LL_ENDL; + } + sGridListRequestReady = true; } From 429ea6c37d4c39c2660f7b4e830dee66d8293d45 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 13 Jun 2018 17:06:55 +0200 Subject: [PATCH 13/14] Fix grid manager to include last modified date in request where it apparently should and handle status 304 response properly (and internal server errors presumably as well) --- indra/newview/fsgridhandler.cpp | 32 ++++++++++++++++++++------------ indra/newview/fsgridhandler.h | 4 ++-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index b1c3028c25..4d14e46566 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -50,7 +50,7 @@ #include "fscorehttputil.h" #include "lfsimfeaturehandler.h" // -void downloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) +void gridDownloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) { LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD( aData ); @@ -62,6 +62,15 @@ void downloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, } } + else if (status.getType() == HTTP_NOT_MODIFIED && LLGridManager::TRYLEGACY != mState) // not modified + { + mOwner->addGrid(mData, LLGridManager::FINISH); + } + else if (HTTP_INTERNAL_ERROR == status.getType() && LLGridManager::LOCAL == mState) //add localhost even if its not up + { + mOwner->addGrid(mData, LLGridManager::FINISH); + //since we know now that its not up we cold also start it + } else if (LLGridManager::TRYLEGACY == mState) //we did TRYLEGACY and faild { LLSD args; @@ -88,9 +97,9 @@ void downloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, } } -void downloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) +void gridDownloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) { - mOwner->decResponderCount(); + //mOwner->decResponderCount(); LLSD header = aData[ LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS ][ LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_HEADERS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD( aData[ LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS ] ); @@ -126,10 +135,6 @@ void downloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mDat mOwner->addGrid(mData, LLGridManager::FAIL); } } - else if (HTTP_NOT_MODIFIED == status.getType() && LLGridManager::TRYLEGACY != mState)// not modified - { - mOwner->addGrid(mData, LLGridManager::FINISH); - } else if (HTTP_INTERNAL_ERROR == status.getType() && LLGridManager::LOCAL == mState) //add localhost even if its not up { mOwner->addGrid(mData, LLGridManager::FINISH); @@ -137,7 +142,7 @@ void downloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mDat } else { - downloadError( aData[ LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS ], mOwner, mData, mState ); + gridDownloadError( aData[ LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS ], mOwner, mData, mState ); } } @@ -622,9 +627,12 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) LLDate saved_value = grid_entry->grid["LastModified"]; last_modified = (time_t)saved_value.secondsSinceEpoch(); } + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setWantHeaders(true); + httpOpts->setLastModified((long)last_modified); - FSCoreHttpUtil::callbackHttpGetRaw( uri, boost::bind( downloadComplete, _1, this, grid_entry, state ), - boost::bind( downloadError, _1, this, grid_entry, state ) ); + FSCoreHttpUtil::callbackHttpGetRaw( uri, boost::bind( gridDownloadComplete, _1, this, grid_entry, state ), + boost::bind( gridDownloadError, _1, this, grid_entry, state ), LLCore::HttpHeaders::ptr_t(), httpOpts ); return; } } @@ -643,8 +651,8 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) LL_WARNS() << "No gridinfo found. Trying if legacy login page exists: " << uri << LL_ENDL; - FSCoreHttpUtil::callbackHttpGetRaw( uri, boost::bind( downloadComplete, _1, this, grid_entry, state ), - boost::bind( downloadError, _1, this, grid_entry, state ) ); + FSCoreHttpUtil::callbackHttpGetRaw( uri, boost::bind( gridDownloadComplete, _1, this, grid_entry, state ), + boost::bind( gridDownloadError, _1, this, grid_entry, state ) ); return; } diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h index 4fcb131924..330e11bfa3 100644 --- a/indra/newview/fsgridhandler.h +++ b/indra/newview/fsgridhandler.h @@ -248,8 +248,8 @@ public: private: friend class GridInfoRequestResponder; - friend void downloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ); - friend void downloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ); + friend void gridDownloadComplete( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ); + friend void gridDownloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ); void incResponderCount(){++mResponderCount;} void decResponderCount(){--mResponderCount;} From 7dad861c1b717b9d15e8ae288738dca169eb212c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 13 Jun 2018 17:07:18 +0200 Subject: [PATCH 14/14] Fix XUI parser warning LLView::getChild: Making dummy class LLUICtrl named "cookies_enabled" in Preferences --- indra/newview/llfloaterpreference.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1312c21a22..26f8b9e483 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -966,7 +966,7 @@ void LLFloaterPreference::apply() // Sound cache setSoundCacheLocation(gSavedSettings.getString("FSSoundCacheLocation")); - LLViewerMedia::setCookiesEnabled(getChild("cookies_enabled")->getValue()); + //LLViewerMedia::setCookiesEnabled(getChild("cookies_enabled")->getValue()); // Doesn't exist anymore as of 13-06-2018 if (hasChild("web_proxy_enabled", TRUE) &&hasChild("web_proxy_editor", TRUE) && hasChild("web_proxy_port", TRUE)) {