Close current packet fix

This commit is contained in:
Atlante45 2015-09-17 16:10:01 +02:00
parent f6665a4ac6
commit a34e1d85a5
2 changed files with 2 additions and 2 deletions

View file

@ -105,7 +105,7 @@ std::unique_ptr<Packet> PacketList::createPacketWithExtendedHeader() {
}
void PacketList::closeCurrentPacket(bool shouldSendEmpty) {
if (shouldSendEmpty && !_currentPacket) {
if (shouldSendEmpty && !_currentPacket && _packets.empty()) {
_currentPacket = createPacketWithExtendedHeader();
}

View file

@ -282,7 +282,7 @@ void UDTTest::sendPacket() {
packetList->write(randomPaddedData);
}
packetList->closeCurrentPacket(false);
packetList->closeCurrentPacket();
_totalQueuedBytes += packetList->getDataSize();
_totalQueuedPackets += packetList->getNumPackets();