From aa2a8edc6f332154aafa68c6eff5002a6fd348a0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 8 Oct 2015 15:44:18 -0700 Subject: [PATCH] use _segmentStartIndex before changing its value --- libraries/networking/src/udt/PacketList.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/udt/PacketList.cpp b/libraries/networking/src/udt/PacketList.cpp index 28c0a034c7..09d8628a1c 100644 --- a/libraries/networking/src/udt/PacketList.cpp +++ b/libraries/networking/src/udt/PacketList.cpp @@ -197,11 +197,11 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) { // copy from currentPacket where the segment started to the beginning of the newPacket newPacket->write(_currentPacket->getPayload() + _segmentStartIndex, segmentSize); - // the current segment now starts at the beginning of the new packet - _segmentStartIndex = _extendedHeader.size(); - // shrink the current payload to the actual size of the packet _currentPacket->setPayloadSize(_segmentStartIndex); + + // the current segment now starts at the beginning of the new packet + _segmentStartIndex = _extendedHeader.size(); } }