comparison lib/Test/Nginx/HTTP3.pm @ 1958:70302d2090ad

Tests: fixed HTTP/3 stream offset adjustment when sending body. Previously, size of the body without the DATA frame header was used, resulting in incorrect offset being used in further QUIC frames, making it impossible to send the request body in multiple DATA frames.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 27 Apr 2024 18:55:08 +0300
parents 2c4f1019ee0d
children 9877dce42a59
comparison
equal deleted inserted replaced
1957:c544b7120a6d 1958:70302d2090ad
468 my ($self, $body, $sid, $extra) = @_; 468 my ($self, $body, $sid, $extra) = @_;
469 469
470 my $buf = pack_body($self, $body) if defined $body; 470 my $buf = pack_body($self, $body) if defined $body;
471 my $offset = $self->{streams}{$sid}{sent}; 471 my $offset = $self->{streams}{$sid}{sent};
472 472
473 $self->{streams}{$sid}{sent} += length($body); 473 $self->{streams}{$sid}{sent} += length($buf);
474 $self->raw_write($self->build_stream($buf, 474 $self->raw_write($self->build_stream($buf,
475 start => $extra->{body_more}, sid => $sid, offset => $offset)); 475 start => $extra->{body_more}, sid => $sid, offset => $offset));
476 } 476 }
477 477
478 sub pack_body { 478 sub pack_body {