Skip to content

Commit

Permalink
ReceiveReliabilityLayer: limit the size of order channels
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Mar 7, 2023
1 parent 939abd0 commit 371190f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/generic/ReceiveReliabilityLayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 371190f

Please # to comment.