Skip to content

Commit 371190f

Browse files
committed
ReceiveReliabilityLayer: limit the size of order channels
1 parent 939abd0 commit 371190f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/generic/ReceiveReliabilityLayer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ private function handleEncapsulatedPacket(EncapsulatedPacket $packet) : void{
225225

226226
$this->receiveOrderedIndex[$packet->orderChannel] = $i;
227227
}elseif($packet->orderIndex > $this->receiveOrderedIndex[$packet->orderChannel]){
228+
if(count($this->receiveOrderedPackets[$packet->orderChannel]) >= self::$WINDOW_SIZE){
229+
//queue overflow for this channel - we should probably disconnect the peer at this point
230+
return;
231+
}
228232
$this->receiveOrderedPackets[$packet->orderChannel][$packet->orderIndex] = $packet;
229233
}else{
230234
//duplicate/already received packet

0 commit comments

Comments
 (0)