summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-01-13 00:06:17 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-01-13 00:06:17 +0000
commitdbf45ad4294a59c050982b5a417fe86272026454 (patch)
tree27453a60cab30c5380456ba111b7fc81acfc5c7d /indra/llmessage
parent46444df6ded3c31bd874b36a55e95dfb01a81f0b (diff)
merge -r 56266 release-candidate
merge -r 56301 release-candidate Fixes for llxfer.cpp and llaudiodecodemgr.cpp (asset upload truncation bug) llxfer.cpp got missed somehow the first time round, grr!
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llxfer.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index 154696eb4e..f43a8a56ff 100644
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -190,19 +190,26 @@ void LLXfer::sendPacket(S32 packet_num)
if (packet_num)
{
num_copy = llmin(fdata_size, (S32)sizeof(fdata_buf));
- num_copy = llmin(num_copy, (S32)(sizeof(mBuffer) - desired_read_position));
+ num_copy = llmin(num_copy, (S32)(mBufferLength - desired_read_position));
if (num_copy > 0)
{
memcpy(fdata_buf,&mBuffer[desired_read_position],num_copy);
}
}
- else // if we're the first packet, encode size as an additional S32 at start of data
- {
+ else
+ {
+ // if we're the first packet, encode size as an additional S32
+ // at start of data.
num_copy = llmin(fdata_size, (S32)(sizeof(fdata_buf)-sizeof(S32)));
- num_copy = llmin(num_copy, (S32)(sizeof(mBuffer) - desired_read_position));
+ num_copy = llmin(
+ num_copy,
+ (S32)(mBufferLength - desired_read_position));
if (num_copy > 0)
{
- memcpy(fdata_buf+sizeof(S32),&mBuffer[desired_read_position],fdata_size);
+ memcpy(
+ fdata_buf + sizeof(S32),
+ &mBuffer[desired_read_position],
+ num_copy);
}
fdata_size += sizeof(S32);
htonmemcpy(fdata_buf,&mXferSize, MVT_S32, sizeof(S32));