summaryrefslogtreecommitdiff
path: root/indra/llmessage/llpacketbuffer.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-19 00:03:19 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-03-19 00:03:42 +0200
commit969ed536806dce1fe2fa8fc9b312f1c80e671d84 (patch)
tree3e8c7e74cbecf7aefe250b03a72651dd781bf8ed /indra/llmessage/llpacketbuffer.cpp
parentf462037b8e3474115a1f039ce0cd56c98e320227 (diff)
parentc99e3167ed8549bc13d7df03b1e12dc15b0a080f (diff)
Merge branch 'release/2025.03' into release/2025.04
Diffstat (limited to 'indra/llmessage/llpacketbuffer.cpp')
-rw-r--r--indra/llmessage/llpacketbuffer.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp
index dc5c7a73cb..0b04a560be 100644
--- a/indra/llmessage/llpacketbuffer.cpp
+++ b/indra/llmessage/llpacketbuffer.cpp
@@ -32,8 +32,6 @@
#include "lltimer.h"
#include "llhost.h"
-///////////////////////////////////////////////////////////
-
LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 size) : mHost(host)
{
mSize = 0;
@@ -41,7 +39,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32
if (size > NET_BUFFER_SIZE)
{
- LL_ERRS() << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << LL_ENDL;
+ LL_ERRS() << "Constructing packet with size=" << size << " > " << NET_BUFFER_SIZE << LL_ENDL;
}
else
{
@@ -51,7 +49,6 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32
mSize = size;
}
}
-
}
LLPacketBuffer::LLPacketBuffer (S32 hSocket)
@@ -59,18 +56,29 @@ LLPacketBuffer::LLPacketBuffer (S32 hSocket)
init(hSocket);
}
-///////////////////////////////////////////////////////////
-
LLPacketBuffer::~LLPacketBuffer ()
{
}
-///////////////////////////////////////////////////////////
-
-void LLPacketBuffer::init (S32 hSocket)
+void LLPacketBuffer::init(S32 hSocket)
{
mSize = receive_packet(hSocket, mData);
mHost = ::get_sender();
mReceivingIF = ::get_receiving_interface();
}
+void LLPacketBuffer::init(const char* buffer, S32 data_size, const LLHost& host)
+{
+ if (data_size > NET_BUFFER_SIZE)
+ {
+ LL_ERRS() << "Initializing packet with size=" << data_size << " > " << NET_BUFFER_SIZE << LL_ENDL;
+ }
+ else
+ {
+ memcpy(mData, buffer, data_size);
+ mSize = data_size;
+ mHost = host;
+ mReceivingIF = ::get_receiving_interface();
+ }
+}
+