mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Merge pull request #29 from birarda/atp
add an assert that enqueue packet is truly from message
This commit is contained in:
commit
598b9b2819
2 changed files with 5 additions and 1 deletions
|
@ -737,6 +737,10 @@ void Connection::updateCongestionControlAndSendQueue(std::function<void ()> cong
|
|||
}
|
||||
|
||||
void PendingReceivedMessage::enqueuePacket(std::unique_ptr<Packet> packet) {
|
||||
Q_ASSERT_X(packet->isPartOfMessage(),
|
||||
"PendingReceivedMessage::enqueuePacket",
|
||||
"called with a packet that is not part of a message");
|
||||
|
||||
if (_isComplete) {
|
||||
qCDebug(networking) << "UNEXPECTED: Received packet for a message that is already complete";
|
||||
return;
|
||||
|
|
|
@ -215,7 +215,7 @@ void Socket::readPendingDatagrams() {
|
|||
} else {
|
||||
// setup a Packet from the data we just read
|
||||
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, senderSockAddr);
|
||||
|
||||
|
||||
// call our verification operator to see if this packet is verified
|
||||
if (!_packetFilterOperator || _packetFilterOperator(*packet)) {
|
||||
if (packet->isReliable()) {
|
||||
|
|
Loading…
Reference in a new issue