summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-04-25 09:13:23 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-04-25 09:13:23 -0400
commitf162693a23fe5cfda8dab3857718624033812d30 (patch)
tree0768f9ea570b248b48e4caa33103e3d55c625466 /indra/llmessage
parentd8931c9269a90cd01f6f6ff4de83b8fb41df11d3 (diff)
parentd98fc504a1d4bc292ba86acdda053c8b4598a193 (diff)
Merge Maint YZ branch 'main' into DRTVWR-588-cleanup-timers
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/CMakeLists.txt2
-rw-r--r--indra/llmessage/llavatarnamecache.cpp2
-rw-r--r--indra/llmessage/llcoproceduremanager.cpp29
-rw-r--r--indra/llmessage/llcorehttputil.cpp27
-rw-r--r--indra/llmessage/llcorehttputil.h33
-rw-r--r--indra/llmessage/lldatapacker.cpp7
-rw-r--r--indra/llmessage/llexperiencecache.h4
-rw-r--r--indra/llmessage/llgenericstreamingmessage.cpp72
-rw-r--r--indra/llmessage/llgenericstreamingmessage.h50
-rw-r--r--indra/llmessage/lliohttpserver.cpp2
-rw-r--r--indra/llmessage/lliopipe.h2
-rw-r--r--indra/llmessage/lliosocket.h4
-rw-r--r--indra/llmessage/llproxy.h2
-rw-r--r--indra/llmessage/llservice.h2
-rw-r--r--indra/llmessage/llstoredmessage.h2
-rw-r--r--indra/llmessage/llxfer.cpp9
-rw-r--r--indra/llmessage/message.cpp1
-rw-r--r--indra/llmessage/message_prehash.cpp1
-rw-r--r--indra/llmessage/message_prehash.h1
-rw-r--r--indra/llmessage/tests/llcoproceduremanager_test.cpp2
-rw-r--r--indra/llmessage/tests/llcurl_stub.cpp2
-rwxr-xr-xindra/llmessage/tests/test_llsdmessage_peer.py1
22 files changed, 190 insertions, 67 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/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 87fd5a154f..f7a9f55685 100644
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -64,7 +64,6 @@ LLCore::HttpRequest::ptr_t sHttpRequest;
LLCore::HttpHeaders::ptr_t sHttpHeaders;
LLCore::HttpOptions::ptr_t sHttpOptions;
LLCore::HttpRequest::policy_t sHttpPolicy;
-LLCore::HttpRequest::priority_t sHttpPriority;
/* Sample response:
<?xml version="1.0"?>
@@ -121,7 +120,6 @@ LLAvatarNameCache::LLAvatarNameCache()
sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders());
sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions());
sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID;
- sHttpPriority = 0;
}
LLAvatarNameCache::~LLAvatarNameCache()
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp
index d310cefd1e..c0a5e361b1 100644
--- a/indra/llmessage/llcoproceduremanager.cpp
+++ b/indra/llmessage/llcoproceduremanager.cpp
@@ -95,7 +95,7 @@ public:
private:
struct QueuedCoproc
{
- typedef boost::shared_ptr<QueuedCoproc> ptr_t;
+ typedef std::shared_ptr<QueuedCoproc> ptr_t;
QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) :
mName(name),
@@ -115,7 +115,7 @@ private:
// Use shared_ptr to control the lifespan of our CoprocQueue_t instance
// because the consuming coroutine might outlive this LLCoprocedurePool
// instance.
- typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr;
+ typedef std::shared_ptr<CoprocQueue_t> CoprocQueuePtr;
std::string mPoolName;
size_t mPoolSize, mActiveCoprocsCount, mPending;
@@ -301,7 +301,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):
mPoolSize(size),
mActiveCoprocsCount(0),
mPending(0),
- mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),
+ mPendingCoprocs(std::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),
mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mCoroMapping()
{
@@ -364,8 +364,27 @@ 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;
- auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc));
+ 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(std::make_shared<QueuedCoproc>(name, id, proc));
if (pushed == boost::fibers::channel_op_status::success)
{
++mPending;
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index 6b9ce54c92..460740cebc 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -131,7 +131,6 @@ bool responseToLLSD(HttpResponse * response, bool log, LLSD & out_llsd)
HttpHandle requestPostWithLLSD(HttpRequest * request,
HttpRequest::policy_t policy_id,
- HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const HttpOptions::ptr_t &options,
@@ -145,7 +144,6 @@ HttpHandle requestPostWithLLSD(HttpRequest * request,
LLSDSerialize::toXML(body, bas);
handle = request->requestPost(policy_id,
- priority,
url,
ba,
options,
@@ -158,7 +156,6 @@ HttpHandle requestPostWithLLSD(HttpRequest * request,
HttpHandle requestPutWithLLSD(HttpRequest * request,
HttpRequest::policy_t policy_id,
- HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const HttpOptions::ptr_t &options,
@@ -172,7 +169,6 @@ HttpHandle requestPutWithLLSD(HttpRequest * request,
LLSDSerialize::toXML(body, bas);
handle = request->requestPut(policy_id,
- priority,
url,
ba,
options,
@@ -184,7 +180,6 @@ HttpHandle requestPutWithLLSD(HttpRequest * request,
HttpHandle requestPatchWithLLSD(HttpRequest * request,
HttpRequest::policy_t policy_id,
- HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const HttpOptions::ptr_t &options,
@@ -198,7 +193,6 @@ HttpHandle requestPatchWithLLSD(HttpRequest * request,
LLSDSerialize::toXML(body, bas);
handle = request->requestPatch(policy_id,
- priority,
url,
ba,
options,
@@ -672,10 +666,9 @@ const std::string HttpCoroutineAdapter::HTTP_RESULTS_CONTENT("content");
const std::string HttpCoroutineAdapter::HTTP_RESULTS_RAW("raw");
HttpCoroutineAdapter::HttpCoroutineAdapter(const std::string &name,
- LLCore::HttpRequest::policy_t policyId, LLCore::HttpRequest::priority_t priority) :
+ LLCore::HttpRequest::policy_t policyId) :
mAdapterName(name),
mPolicyId(policyId),
- mPriority(priority),
mYieldingHandle(LLCORE_HTTP_HANDLE_INVALID),
mWeakRequest(),
mWeakHandler()
@@ -709,7 +702,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPostWithLLSD(request,
- mPolicyId, mPriority, url, body, options, headers,
+ mPolicyId, url, body, options, headers,
handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -832,7 +825,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- LLCore::HttpHandle hhandle = request->requestPost(mPolicyId, mPriority, url, rawbody.get(),
+ LLCore::HttpHandle hhandle = request->requestPost(mPolicyId, url, rawbody.get(),
options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -890,7 +883,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPutWithLLSD(request,
- mPolicyId, mPriority, url, body, options, headers,
+ mPolicyId, url, body, options, headers,
handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -916,7 +909,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- LLCore::HttpHandle hhandle = request->requestPut(mPolicyId, mPriority,
+ LLCore::HttpHandle hhandle = request->requestPut(mPolicyId,
url, rawbody.get(), options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -972,7 +965,7 @@ LLSD HttpCoroutineAdapter::getAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- LLCore::HttpHandle hhandle = request->requestGet(mPolicyId, mPriority,
+ LLCore::HttpHandle hhandle = request->requestGet(mPolicyId,
url, options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -1018,7 +1011,7 @@ LLSD HttpCoroutineAdapter::deleteAndSuspend_(LLCore::HttpRequest::ptr_t &request
checkDefaultHeaders(headers);
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
- LLCore::HttpHandle hhandle = request->requestDelete(mPolicyId, mPriority,
+ LLCore::HttpHandle hhandle = request->requestDelete(mPolicyId,
url, options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -1056,7 +1049,7 @@ LLSD HttpCoroutineAdapter::patchAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
LLCore::HttpHandle hhandle = requestPatchWithLLSD(request,
- mPolicyId, mPriority, url, body, options, headers,
+ mPolicyId, url, body, options, headers,
handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -1098,7 +1091,7 @@ LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
//
- LLCore::HttpHandle hhandle = request->requestCopy(mPolicyId, mPriority, url,
+ LLCore::HttpHandle hhandle = request->requestCopy(mPolicyId, url,
options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
@@ -1140,7 +1133,7 @@ LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request,
// The HTTPCoroHandler does not self delete, so retrieval of a the contained
// pointer from the smart pointer is safe in this case.
//
- LLCore::HttpHandle hhandle = request->requestMove(mPolicyId, mPriority, url,
+ LLCore::HttpHandle hhandle = request->requestMove(mPolicyId, url,
options, headers, handler);
if (hhandle == LLCORE_HTTP_HANDLE_INVALID)
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index 8df1425f2a..fc561c6b0f 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -116,7 +116,6 @@ std::string responseToString(LLCore::HttpResponse * response);
///
LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t &options,
@@ -125,20 +124,18 @@ LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest * request,
inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t & options,
const LLCore::HttpHeaders::ptr_t & headers,
const LLCore::HttpHandler::ptr_t & handler)
{
- return requestPostWithLLSD(request.get(), policy_id, priority,
+ return requestPostWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpHandler::ptr_t &handler)
@@ -146,7 +143,7 @@ inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & reque
LLCore::HttpOptions::ptr_t options;
LLCore::HttpHeaders::ptr_t headers;
- return requestPostWithLLSD(request.get(), policy_id, priority,
+ return requestPostWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
@@ -169,7 +166,6 @@ inline LLCore::HttpHandle requestPostWithLLSD(LLCore::HttpRequest::ptr_t & reque
///
LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t &options,
@@ -178,20 +174,18 @@ LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest * request,
inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t & options,
const LLCore::HttpHeaders::ptr_t & headers,
LLCore::HttpHandler::ptr_t handler)
{
- return requestPutWithLLSD(request.get(), policy_id, priority,
+ return requestPutWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
LLCore::HttpHandler::ptr_t handler)
@@ -199,7 +193,7 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
LLCore::HttpOptions::ptr_t options;
LLCore::HttpHeaders::ptr_t headers;
- return requestPutWithLLSD(request.get(), policy_id, priority,
+ return requestPutWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
@@ -221,7 +215,6 @@ inline LLCore::HttpHandle requestPutWithLLSD(LLCore::HttpRequest::ptr_t & reques
///
LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest * request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t &options,
@@ -230,20 +223,18 @@ LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest * request,
inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpOptions::ptr_t & options,
const LLCore::HttpHeaders::ptr_t & headers,
const LLCore::HttpHandler::ptr_t & handler)
{
- return requestPatchWithLLSD(request.get(), policy_id, priority,
+ return requestPatchWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & request,
LLCore::HttpRequest::policy_t policy_id,
- LLCore::HttpRequest::priority_t priority,
const std::string & url,
const LLSD & body,
const LLCore::HttpHandler::ptr_t &handler)
@@ -251,7 +242,7 @@ inline LLCore::HttpHandle requestPatchWithLLSD(LLCore::HttpRequest::ptr_t & requ
LLCore::HttpOptions::ptr_t options;
LLCore::HttpHeaders::ptr_t headers;
- return requestPatchWithLLSD(request.get(), policy_id, priority,
+ return requestPatchWithLLSD(request.get(), policy_id,
url, body, options, headers, handler);
}
@@ -272,8 +263,8 @@ class HttpCoroHandler : public LLCore::HttpHandler
{
public:
- typedef boost::shared_ptr<HttpCoroHandler> ptr_t;
- typedef boost::weak_ptr<HttpCoroHandler> wptr_t;
+ typedef std::shared_ptr<HttpCoroHandler> ptr_t;
+ typedef std::weak_ptr<HttpCoroHandler> wptr_t;
HttpCoroHandler(LLEventStream &reply);
@@ -326,11 +317,10 @@ public:
static const std::string HTTP_RESULTS_CONTENT;
static const std::string HTTP_RESULTS_RAW;
- typedef boost::shared_ptr<HttpCoroutineAdapter> ptr_t;
- typedef boost::weak_ptr<HttpCoroutineAdapter> wptr_t;
+ typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t;
+ typedef std::weak_ptr<HttpCoroutineAdapter> wptr_t;
- HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId,
- LLCore::HttpRequest::priority_t priority = 0L);
+ HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId);
~HttpCoroutineAdapter();
/// Execute a Post transaction on the supplied URL and yield execution of
@@ -677,7 +667,6 @@ private:
void checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers);
std::string mAdapterName;
- LLCore::HttpRequest::priority_t mPriority;
LLCore::HttpRequest::policy_t mPolicyId;
LLCore::HttpHandle mYieldingHandle;
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 9f7768f78e..b7013dbb6e 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -298,6 +298,13 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char
}
htolememcpy(&size, mCurBufferp, MVT_S32, 4);
+
+ if (size < 0)
+ {
+ LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData unpacked invalid size, aborting!" << LL_ENDL;
+ return FALSE;
+ }
+
mCurBufferp += 4;
if (!verifyLength(size, name))
diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h
index 1c97133723..3ee45da2e7 100644
--- a/indra/llmessage/llexperiencecache.h
+++ b/indra/llmessage/llexperiencecache.h
@@ -106,13 +106,13 @@ public:
private:
virtual ~LLExperienceCache();
- virtual void initSingleton();
+ virtual void initSingleton() override;
typedef boost::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn;
// Callback types for get()
typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t;
- typedef boost::shared_ptr<callback_signal_t> signal_ptr;
+ typedef std::shared_ptr<callback_signal_t> signal_ptr;
// May have multiple callbacks for a single ID, which are
// represented as multiple slots bound to the signal.
// Avoid copying signals via pointers.
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/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index c707c7ad09..e302dd2b5e 100644
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -982,7 +982,7 @@ LLHTTPNode& LLIOHTTPServer::create(
}
LLHTTPResponseFactory* factory = new LLHTTPResponseFactory;
- boost::shared_ptr<LLChainIOFactory> factory_ptr(factory);
+ std::shared_ptr<LLChainIOFactory> factory_ptr(factory);
LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr);
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index 7fd4cee8ba..e6ac8ebfc2 100644
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -89,7 +89,7 @@ public:
/**
* @brief Scattered memory container.
*/
- typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t;
+ typedef std::shared_ptr<LLBufferArray> buffer_ptr_t;
/**
* @brief Enumeration for IO return codes
diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h
index 303d80eb14..a62b3c0204 100644
--- a/indra/llmessage/lliosocket.h
+++ b/indra/llmessage/lliosocket.h
@@ -65,7 +65,7 @@ public:
/**
* @brief Reference counted shared pointers to sockets.
*/
- typedef boost::shared_ptr<LLSocket> ptr_t;
+ typedef std::shared_ptr<LLSocket> ptr_t;
/**
* @brief Type of socket to create.
@@ -305,7 +305,7 @@ class LLIOServerSocket : public LLIOPipe
{
public:
typedef LLSocket::ptr_t socket_t;
- typedef boost::shared_ptr<LLChainIOFactory> factory_t;
+ typedef std::shared_ptr<LLChainIOFactory> factory_t;
LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor);
virtual ~LLIOServerSocket();
diff --git a/indra/llmessage/llproxy.h b/indra/llmessage/llproxy.h
index 25f6977e14..8a64cdbfaa 100644
--- a/indra/llmessage/llproxy.h
+++ b/indra/llmessage/llproxy.h
@@ -226,7 +226,7 @@ class LLProxy: public LLSingleton<LLProxy>
LLSINGLETON(LLProxy);
LOG_CLASS(LLProxy);
- /*virtual*/ void initSingleton();
+ /*virtual*/ void initSingleton() override;
public:
// Static check for enabled status for UDP packets. Call from main thread only.
diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h
index 9c09aeb44c..f215acab56 100644
--- a/indra/llmessage/llservice.h
+++ b/indra/llmessage/llservice.h
@@ -116,7 +116,7 @@ class LLService : public LLIOPipe
public:
//typedef boost::intrusive_ptr<LLServiceCreator> creator_t;
//typedef boost::intrusive_ptr<LLService> service_t;
- typedef boost::shared_ptr<LLChainIOFactory> creator_t;
+ typedef std::shared_ptr<LLChainIOFactory> creator_t;
/**
* @brief This method is used to register a protocol name with a
diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h
index 9c98e2c558..6ea150fda3 100644
--- a/indra/llmessage/llstoredmessage.h
+++ b/indra/llmessage/llstoredmessage.h
@@ -46,7 +46,7 @@ private:
std::string mName;
};
-typedef boost::shared_ptr<LLStoredMessage> LLStoredMessagePtr;
+typedef std::shared_ptr<LLStoredMessage> LLStoredMessagePtr;
#endif // LL_STOREDMESSAGE_H
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index 93d5cfc131..212d0619d1 100644
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -386,12 +386,3 @@ std::ostream& operator<< (std::ostream& os, LLXfer &hh)
os << hh.getFileName() ;
return os;
}
-
-
-
-
-
-
-
-
-
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/llcoproceduremanager_test.cpp b/indra/llmessage/tests/llcoproceduremanager_test.cpp
index a1a4ce0520..d6481d4eea 100644
--- a/indra/llmessage/tests/llcoproceduremanager_test.cpp
+++ b/indra/llmessage/tests/llcoproceduremanager_test.cpp
@@ -48,7 +48,7 @@
#pragma warning(disable: 4702)
#endif
-LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string const&, unsigned int, unsigned int)
+LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string const&, unsigned int)
{
}
diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp
index b7fdf4f437..1c571a74da 100644
--- a/indra/llmessage/tests/llcurl_stub.cpp
+++ b/indra/llmessage/tests/llcurl_stub.cpp
@@ -49,7 +49,7 @@ void LLCurl::Responder::httpCompleted()
}
void LLCurl::Responder::completedRaw(LLChannelDescriptors const&,
- boost::shared_ptr<LLBufferArray> const&)
+ std::shared_ptr<LLBufferArray> const&)
{
}
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index 8e9b6c09e7..ff8f40a144 100755
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -33,7 +33,6 @@ import os
import sys
from http.server import HTTPServer, BaseHTTPRequestHandler
-from llsd.fastest_elementtree import parse as xml_parse
import llsd
from testrunner import freeport, run, debug, VERBOSE
import time