diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-28 21:11:23 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-28 21:11:23 +0300 |
| commit | d3bd73ab923b8010bb395505b95bcc38b661162e (patch) | |
| tree | 56b5fadba1f247fc42b6d3a3062154d61a43abac /indra/llmessage/llpacketbuffer.cpp | |
| parent | 3af711e6da9d0004ce1b565bfadee634f087b89a (diff) | |
| parent | de8275b14b30bf754cdba1da867cb2e6c2783639 (diff) | |
Merge branch 'main' into marchcat/slua-editor-merge
# Conflicts:
# .github/workflows/build.yaml
# indra/newview/llmeshrepository.cpp
# indra/newview/llmeshrepository.h
# indra/newview/llpreviewscript.h
Diffstat (limited to 'indra/llmessage/llpacketbuffer.cpp')
| -rw-r--r-- | indra/llmessage/llpacketbuffer.cpp | 26 |
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(); + } +} + |
