fix packet list segment break

This commit is contained in:
Stephen Birarda 2015-07-17 15:27:57 -07:00
parent fe0cdc0529
commit 9a4cc1308d

View file

@ -83,8 +83,10 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) {
Q_ASSERT(false);
}
int segmentSize = _currentPacket->pos() - _segmentStartIndex;
// copy from currentPacket where the segment started to the beginning of the newPacket
newPacket->write(_currentPacket->getPayload() + _segmentStartIndex, numBytesToEnd);
newPacket->write(_currentPacket->getPayload() + _segmentStartIndex, segmentSize);
// the current segment now starts at the beginning of the new packet
_segmentStartIndex = 0;