[nginx-tests] Tests: optimized processing of large QUIC packets ...
Maxim Dounin
mdounin at mdounin.ru
Mon Jun 3 15:15:19 UTC 2024
details: http://freenginx.org/hg/nginx-tests/rev/c7315caf2110
branches:
changeset: 1983:c7315caf2110
user: Maxim Dounin <mdounin at mdounin.ru>
date: Mon Jun 03 04:17:28 2024 +0300
description:
Tests: optimized processing of large QUIC packets with padding.
Path MTU discovery packets might contain a lot of padding, and creating
a copy of the whole buffer for each PADDING frame, which is just one
byte with type 0, consumes lots of resources. This was seen to result
in flapping of at least h3_keepalive.t and h3_ssl_early_data.t tests.
Fix is to copy at most 8 bytes for parse_int() calls when parsing
frame types.
diffstat:
lib/Test/Nginx/HTTP3.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff --git a/lib/Test/Nginx/HTTP3.pm b/lib/Test/Nginx/HTTP3.pm
--- a/lib/Test/Nginx/HTTP3.pm
+++ b/lib/Test/Nginx/HTTP3.pm
@@ -1361,7 +1361,7 @@ sub parse_frames {
my $offset = 0;
while ($offset < length($buf)) {
- my ($tlen, $type) = parse_int(substr($buf, $offset));
+ my ($tlen, $type) = parse_int(substr($buf, $offset, 8));
$offset += $tlen;
next if $type == 0;
my $frame = { type => $type };
More information about the nginx-devel
mailing list