comparison lib/Test/Nginx/HTTP3.pm @ 1927:55e0dee863e2

Tests: handled receiving QUIC STREAM FIN in a separate packet. Since a STREAM frame with the FIN bit set doesn't carry payload (as sent by nginx), empty DATA frame is emulated.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 16 Aug 2023 16:32:12 +0400
parents 0fb9ca9046bf
children 2df7d700518f
comparison
equal deleted inserted replaced
1926:0fb9ca9046bf 1927:55e0dee863e2
510 my ($stream, $buf, $eof) = $self->read_stream_message($wait); 510 my ($stream, $buf, $eof) = $self->read_stream_message($wait);
511 511
512 unless (defined $stream) { 512 unless (defined $stream) {
513 return \@got unless scalar @{$self->{frames_in}}; 513 return \@got unless scalar @{$self->{frames_in}};
514 goto frames; 514 goto frames;
515 }
516
517 if (!length($buf) && $eof) {
518 # emulate empty DATA frame
519 $length = 0;
520 $frame->{length} = $length;
521 $frame->{type} = 'DATA';
522 $frame->{data} = '';
523 $frame->{flags} = $eof;
524 $frame->{sid} = $stream;
525 $frame->{uni} = $uni if defined $uni;
526 goto push_me;
515 } 527 }
516 528
517 if (length($self->{frames_incomplete}[$stream]{buf})) { 529 if (length($self->{frames_incomplete}[$stream]{buf})) {
518 $buf = $self->{frames_incomplete}[$stream]{buf} . $buf; 530 $buf = $self->{frames_incomplete}[$stream]{buf} . $buf;
519 } 531 }