diff options
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llmessage/llcachename.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/llcircuit.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 21 | ||||
-rw-r--r-- | indra/llmessage/llcorehttputil.cpp | 42 | ||||
-rw-r--r-- | indra/llmessage/llcorehttputil.h | 4 | ||||
-rw-r--r-- | indra/llmessage/llgenericstreamingmessage.cpp | 72 | ||||
-rw-r--r-- | indra/llmessage/llgenericstreamingmessage.h | 50 | ||||
-rw-r--r-- | indra/llmessage/llregionflags.h | 5 | ||||
-rw-r--r-- | indra/llmessage/message.cpp | 1 | ||||
-rw-r--r-- | indra/llmessage/message_prehash.cpp | 1 | ||||
-rw-r--r-- | indra/llmessage/message_prehash.h | 1 | ||||
-rwxr-xr-x | indra/llmessage/tests/test_llsdmessage_peer.py | 4 |
13 files changed, 201 insertions, 8 deletions
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 4786956e85..e44309476b 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -30,6 +30,7 @@ set(llmessage_SOURCE_FILES lldispatcher.cpp llexperiencecache.cpp llfiltersd2xmlrpc.cpp + llgenericstreamingmessage.cpp llhost.cpp llhttpnode.cpp llhttpsdhandler.cpp @@ -114,6 +115,7 @@ set(llmessage_HEADER_FILES llextendedstatus.h llfiltersd2xmlrpc.h llfollowcamparams.h + llgenericstreamingmessage.h llhost.h llhttpnode.h llhttpnodeadapter.h diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 66bd85f4e6..a2e85cf6c2 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -552,7 +552,9 @@ std::string LLCacheName::buildUsername(const std::string& full_name) // if the input wasn't a correctly formatted legacy name, just return it // cleaned up from a potential terminal "Resident" - return cleanFullName(full_name); + std::string clean_name = cleanFullName(full_name); + LLStringUtil::toLower(clean_name); + return clean_name; } //static diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 8baa2e328b..a9a292958f 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -271,7 +271,6 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) S32 LLCircuitData::resendUnackedPackets(const F64Seconds now) { - S32 resent_packets = 0; LLReliablePacket *packetp; @@ -375,7 +374,6 @@ S32 LLCircuitData::resendUnackedPackets(const F64Seconds now) // Don't remove it yet, it still gets to try to resend at least once. ++iter; } - resent_packets++; } else { diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index d310cefd1e..ebbaea9b12 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -364,7 +364,26 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced { LLUUID id(LLUUID::generateNewID()); - LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at " << mPending << LL_ENDL; + if (mPoolName == "AIS") + { + // Fetch is going to be spammy. + LL_DEBUGS("CoProcMgr", "Inventory") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName + << "\" at " + << mPending << LL_ENDL; + + if (mPending >= (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1)) + { + // If it's all used up (not supposed to happen, + // fetched should cap it), we are going to crash + LL_WARNS("CoProcMgr", "Inventory") << "About to run out of queue space for Coprocedure(" << name + << ") enqueuing with id=" << id.asString() << " Already pending:" << mPending << LL_ENDL; + } + } + else + { + LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at " + << mPending << LL_ENDL; + } auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc)); if (pushed == boost::fibers::channel_op_status::success) { diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 02f273b204..460740cebc 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -1329,6 +1329,48 @@ void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest: } +/*static*/ +void HttpCoroutineAdapter::callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, + completionCallback_t failure) +{ + LLCoros::instance().launch("HttpCoroutineAdapter::genericDelCoro", + boost::bind(&HttpCoroutineAdapter::trivialDelCoro, url, policyId, success, failure)); +} + +/*static*/ +void HttpCoroutineAdapter::trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, + completionCallback_t failure) +{ + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericDelCoro", policyId)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + + httpOpts->setWantHeaders(true); + + LL_INFOS("HttpCoroutineAdapter", "genericDelCoro") << "Generic DEL for " << url << LL_ENDL; + + LLSD result = httpAdapter->deleteAndSuspend(httpRequest, url, httpOpts); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + if (failure) + { + failure(httpResults); + } + } + else + { + if (success) + { + success(result); + } + } +} + + } // end namespace LLCoreHttpUtil diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 430dc417ac..6d0d68cf24 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -598,6 +598,9 @@ public: callbackHttpPost(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, postData, success, failure); } + static void callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, + completionCallback_t failure = NULL); + /// Generic Get and post routines for HTTP via coroutines. /// These static methods do all required setup for the GET or POST operation. /// When the operation completes successfully they will put the success message in the log at INFO level, @@ -659,6 +662,7 @@ private: static void trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure); static void trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure); + static void trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure); void checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers); diff --git a/indra/llmessage/llgenericstreamingmessage.cpp b/indra/llmessage/llgenericstreamingmessage.cpp new file mode 100644 index 0000000000..8627675c54 --- /dev/null +++ b/indra/llmessage/llgenericstreamingmessage.cpp @@ -0,0 +1,72 @@ +/** + * @file llgenericstreamingmessage.cpp + * @brief Generic Streaming Message helpers. Shared between viewer and simulator. + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "llgenericstreamingmessage.h" + +#include "message.h" + +void LLGenericStreamingMessage::send(LLMessageSystem* msg) +{ +#if 0 // viewer cannot send GenericStreamingMessage + msg->newMessageFast(_PREHASH_GenericStreamingMessage); + + if (mData.size() < 1024 * 7) + { // disable warning about big messages unless we're sending a REALLY big message + msg->tempDisableWarnAboutBigMessage(); + } + else + { + LL_WARNS("Messaging") << "Attempted to send too large GenericStreamingMessage, dropping." << LL_ENDL; + return; + } + + msg->nextBlockFast(_PREHASH_MethodData); + msg->addU16Fast(_PREHASH_Method, mMethod); + msg->nextBlockFast(_PREHASH_DataBlock); + msg->addStringFast(_PREHASH_Data, mData.c_str()); +#endif +} + +void LLGenericStreamingMessage::unpack(LLMessageSystem* msg) +{ + U16* m = (U16*)&mMethod; // squirrely pass enum as U16 by reference + msg->getU16Fast(_PREHASH_MethodData, _PREHASH_Method, *m); + + constexpr int MAX_SIZE = 7 * 1024; + + char buffer[MAX_SIZE]; + + // NOTE: don't use getStringFast to avoid 1200 byte truncation + U32 size = msg->getSizeFast(_PREHASH_DataBlock, _PREHASH_Data); + msg->getBinaryDataFast(_PREHASH_DataBlock, _PREHASH_Data, buffer, size, 0, MAX_SIZE); + + mData.assign(buffer, size); +} + + + diff --git a/indra/llmessage/llgenericstreamingmessage.h b/indra/llmessage/llgenericstreamingmessage.h new file mode 100644 index 0000000000..9ac9719ea1 --- /dev/null +++ b/indra/llmessage/llgenericstreamingmessage.h @@ -0,0 +1,50 @@ +/** + * @file llgenericstreamingmessage.h + * @brief Generic Streaming Message helpers. Shared between viewer and simulator. + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +#include <string> +#include "stdtypes.h" + +class LLMessageSystem; + +class LLGenericStreamingMessage +{ +public: + enum Method : U16 + { + METHOD_GLTF_MATERIAL_OVERRIDE = 0x4175, + METHOD_UNKNOWN = 0xFFFF, + }; + + void send(LLMessageSystem* msg); + void unpack(LLMessageSystem* msg); + + Method mMethod = METHOD_UNKNOWN; + std::string mData; +}; + + diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h index 8548ed51e7..464bf05250 100644 --- a/indra/llmessage/llregionflags.h +++ b/indra/llmessage/llregionflags.h @@ -171,8 +171,9 @@ const U32 ESTATE_ACCESS_MANAGER_REMOVE = 1U << 9; const U32 ESTATE_ACCESS_NO_REPLY = 1U << 10; const U32 ESTATE_ACCESS_FAILED_BAN_ESTATE_MANAGER = 1U << 11; -const S32 ESTATE_MAX_MANAGERS = 15; -const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access, banned +const S32 ESTATE_MAX_MANAGERS = 20; +const S32 ESTATE_MAX_ACCESS_IDS = 500; // max for access +const S32 ESTATE_MAX_BANNED_IDS = 750; // max for banned const S32 ESTATE_MAX_GROUP_IDS = (S32) ESTATE_ACCESS_MAX_ENTRIES_PER_PACKET; // 'Sim Wide Delete' flags diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 19146c64f4..31acc65642 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -3402,6 +3402,7 @@ typedef std::map<const char*, LLMessageBuilder*> BuilderMap; void LLMessageSystem::newMessageFast(const char *name) { + //LL_DEBUGS("Messaging") << "creating new message: " << name << LL_ENDL; LLMessageConfig::Flavor message_flavor = LLMessageConfig::getMessageFlavor(name); LLMessageConfig::Flavor server_flavor = diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 57ea954054..4dccacb889 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1367,6 +1367,7 @@ char const* const _PREHASH_MuteType = LLMessageStringTable::getInstance()->getSt char const* const _PREHASH_IMViaEMail = LLMessageStringTable::getInstance()->getString("IMViaEMail"); char const* const _PREHASH_RentPrice = LLMessageStringTable::getInstance()->getString("RentPrice"); char const* const _PREHASH_GenericMessage = LLMessageStringTable::getInstance()->getString("GenericMessage"); +char const* const _PREHASH_GenericStreamingMessage = LLMessageStringTable::getInstance()->getString("GenericStreamingMessage"); char const* const _PREHASH_ChildAgentAlive = LLMessageStringTable::getInstance()->getString("ChildAgentAlive"); char const* const _PREHASH_AssetType = LLMessageStringTable::getInstance()->getString("AssetType"); char const* const _PREHASH_SpawnPointBlock = LLMessageStringTable::getInstance()->getString("SpawnPointBlock"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 572dadd408..a393bbabb2 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1368,6 +1368,7 @@ extern char const* const _PREHASH_MuteType; extern char const* const _PREHASH_IMViaEMail; extern char const* const _PREHASH_RentPrice; extern char const* const _PREHASH_GenericMessage; +extern char const* const _PREHASH_GenericStreamingMessage; extern char const* const _PREHASH_ChildAgentAlive; extern char const* const _PREHASH_AssetType; extern char const* const _PREHASH_SpawnPointBlock; diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py index 5ba0749e31..8e9b6c09e7 100755 --- a/indra/llmessage/tests/test_llsdmessage_peer.py +++ b/indra/llmessage/tests/test_llsdmessage_peer.py @@ -33,8 +33,8 @@ import os import sys from http.server import HTTPServer, BaseHTTPRequestHandler -from llbase.fastest_elementtree import parse as xml_parse -from llbase import llsd +from llsd.fastest_elementtree import parse as xml_parse +import llsd from testrunner import freeport, run, debug, VERBOSE import time |