diff --git a/src/generic/ReceiveReliabilityLayer.php b/src/generic/ReceiveReliabilityLayer.php index 90a306d..15ba3f0 100644 --- a/src/generic/ReceiveReliabilityLayer.php +++ b/src/generic/ReceiveReliabilityLayer.php @@ -225,6 +225,10 @@ private function handleEncapsulatedPacket(EncapsulatedPacket $packet) : void{ $this->receiveOrderedIndex[$packet->orderChannel] = $i; }elseif($packet->orderIndex > $this->receiveOrderedIndex[$packet->orderChannel]){ + if(count($this->receiveOrderedPackets[$packet->orderChannel]) >= self::$WINDOW_SIZE){ + //queue overflow for this channel - we should probably disconnect the peer at this point + return; + } $this->receiveOrderedPackets[$packet->orderChannel][$packet->orderIndex] = $packet; }else{ //duplicate/already received packet