[PATCH] Tests: fixed warning in case of a closed stream

Maxim Dounin mdounin at mdounin.ru
Wed Apr 5 00:16:32 UTC 2023


Hello!

On Tue, Apr 04, 2023 at 09:17:22AM -0700, Eugene Grebenschikov wrote:

> # HG changeset patch
> # User Eugene Grebenschikov <e.grebenshchikov at nginx.com>
> # Date 1680624896 25200
> #      Tue Apr 04 09:14:56 2023 -0700
> # Node ID 1197c152215b640aef0bdd3c3072f686298347b3
> # Parent  0351dee227a8341e442feeb03920a46b259adeb5
> Tests: fixed warning in case of a closed stream.
> 
> diff -r 0351dee227a8 -r 1197c152215b lib/Test/Nginx/Stream.pm
> --- a/lib/Test/Nginx/Stream.pm	Tue Mar 28 01:36:32 2023 +0400
> +++ b/lib/Test/Nginx/Stream.pm	Tue Apr 04 09:14:56 2023 -0700
> @@ -65,8 +65,8 @@
>  	$s->blocking(0);
>  	while (IO::Select->new($s)->can_write($extra{write_timeout} || 1.5)) {
>  		my $n = $s->syswrite($message);
> +		last unless $n;
>  		log_out(substr($message, 0, $n));
> -		last unless $n;
>  
>  		$message = substr($message, $n);
>  		last unless length $message;

Looks good to me.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list