# HG changeset patch # User Sergey Kandaurov # Date 1686063007 -14400 # Node ID f35824e75b66b2cecda6b6395ded3c5c1944cef4 # Parent c04134b0290bde14b0e92a2cc3fababa2a33ec7d Tests: fixed reading QUIC streams on Perl < 5.24. The parse_stream() routine has had a missing explicit return if there were no streams received. In Perl < 5.24 this used to return no value, or an empty array in the list context. In modern Perl this returns an empty value, or an array of 1 element, which made the check for last index of the returned array work rather by accident. The fix is to return explicitly and to check the array size in callers instead. 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 @@ -1947,7 +1947,7 @@ sub read_stream_message { while (1) { @data = $self->parse_stream(); - return @data if $#data; + return @data if @data; return if scalar @{$self->{frames_in}}; again: @@ -1973,7 +1973,7 @@ again: goto retry if $self->{token}; $self->handle_frames(parse_frames($plaintext), $level); @data = $self->parse_stream(); - return @data if $#data; + return @data if @data; return if scalar @{$self->{frames_in}}; } } @@ -2005,6 +2005,7 @@ sub parse_stream { return ($i, $data, $stream->{eof} ? 1 : 0); } + return; } ###############################################################################