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

Eugene Grebenschikov e.grebenshchikov at nginx.com
Tue Apr 4 16:17:22 UTC 2023


# 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;


More information about the nginx-devel mailing list