Skip to content

Commit a8cf647

Browse files
committed
Tests: fixed decoding QUIC packet numbers with PNL bits set.
1 parent cdfef2a commit a8cf647

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Test/Nginx/HTTP3.pm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,13 @@ mask:
17271727
& ($level == 3 ? "\x1f" : "\x0f");
17281728
my $pnl = unpack("C", substr($buf, 0, 1) & "\x03") + 1;
17291729
substr($buf, $offset, $pnl) ^= substr($mask, 1);
1730-
my $pn = unpack("C", substr($buf, $offset, $pnl));
1730+
1731+
my $pn = 0;
1732+
for my $n (1 .. $pnl) {
1733+
$pn += unpack("C", substr($buf, $offset + $n - 1, 1))
1734+
<< ($pnl - $n) * 8;
1735+
}
1736+
17311737
my $ad = substr($buf, 0, $offset + $pnl);
17321738
return ($ad, $pnl, $pn);
17331739
}

0 commit comments

Comments
 (0)