Skip to content

Commit

Permalink
Merge branch 'master' into kazuho/path-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed May 13, 2024
2 parents 2c11e0f + 052eae2 commit 6481c0f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,8 +1771,8 @@ static void calc_resume_sendrate(quicly_conn_t *conn, uint64_t *rate, uint32_t *

quicly_ratemeter_report(&conn->egress.ratemeter, &reported);

if (reported.smoothed != 0) {
*rate = reported.smoothed;
if (reported.smoothed != 0 || reported.latest != 0) {
*rate = reported.smoothed > reported.latest ? reported.smoothed : reported.latest;
*rtt = conn->egress.loss.rtt.minimum;
} else {
*rate = 0;
Expand Down
44 changes: 41 additions & 3 deletions t/e2e.t
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ subtest "slow-start" => sub {

# read first $size bytes from client $cli (which would be the payload received) and check RT
my $doit = sub {
my ($size, $rt_min, $rt_max) = @_;
my ($size, $rt_min, $rt_max, @cli_args) = @_;
subtest "${size}B" => sub {
my $start_at = time;
open my $fh, "-|", "$cli -p /$size 127.0.0.1 $udpfw_port 2>&1"
open my $fh, "-|", "$cli -p /$size @{[ join ' ', @cli_args ]} 127.0.0.1 $udpfw_port 2>&1"
or die "failed to launch $cli:$!";
for (my $total_read = 0; $total_read < $size;) {
IO::Select->new($fh)->can_read(); # block until the command writes something
Expand Down Expand Up @@ -488,7 +488,45 @@ subtest "slow-start" => sub {
for ([1000, 2, 2.3], [30000, 2.3, 3], [87000, 3.3, 4], [96000, 4, 4.5]);
};
});
}
};

subtest "jumpstart" => sub {
$each_cc->(sub {
my $cc = shift;
plan skip_all => "Cubic TODO respect app-limited (mandatory for jumpstart)"
if $cc eq "cubic";
my $guard = spawn_server("-C", "$cc:20:p", "--jumpstart-default", "80");
$doit->(@$_)
for ([1450 * 45, 2.45, 2.8], [1450 * 90, 3.0, 3.3]);
});
};

subtest "jumpstart-resume" => sub {
$each_cc->(sub {
my $cc = shift;
plan skip_all => "Cubic TODO respect app-limited (mandatory for jumpstart)"
if $cc eq "cubic";
unlink "$tempdir/session";
my $guard = spawn_server("-C", "$cc:10:p", "--jumpstart-max", "80");
# test RT without jumpstart
$doit->(100000, 4, 5);
# train
my $pid = fork;
die "fork failed:$!"
unless defined $pid;
if ($pid == 0) {
open STDOUT, ">", "/dev/null"
or die "failed to redirect STDOUT to /dev/null:$!";
exec $cli, qw(-p /1000000 -i 5000 -s), "$tempdir/session", "127.0.0.1", $udpfw_port;
die "failed to exec $cli:$!";
}
sleep 2; # wait until the connection becomes idle, at which point the token will be sent
kill 'KILL', $pid;
while (waitpid($pid, 0) != $pid) {}
# test RT using the obtained session information
$doit->(100000, 2, 2.999, "-s", "$tempdir/session");
});
};
};

done_testing;
Expand Down

0 comments on commit 6481c0f

Please sign in to comment.