don't process duplicate or pre-handshake packets

This commit is contained in:
Stephen Birarda 2015-08-27 16:55:13 -07:00
parent 458a90d9e1
commit 8ebcb03b2b

View file

@ -221,9 +221,13 @@ void Socket::readPendingDatagrams() {
if (packet->isReliable()) {
// if this was a reliable packet then signal the matching connection with the sequence number
auto& connection = findOrCreateConnection(senderSockAddr);
connection.processReceivedSequenceNumber(packet->getSequenceNumber(),
packet->getDataSize(),
packet->getPayloadSize());
if (!connection.processReceivedSequenceNumber(packet->getSequenceNumber(),
packet->getDataSize(),
packet->getPayloadSize())) {
// the connection indicated that we should not continue processing this packet
return;
}
}
if (packet->isPartOfMessage()) {