changeset 875:c380b4b7e2e4

Tests: compatibility with perl < 5.12 in Stream.pm.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 22 Mar 2016 18:50:56 +0300
parents 66b8e350b9c8
children a6abbfed42c0
files lib/Test/Nginx/Stream.pm
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Test/Nginx/Stream.pm
+++ b/lib/Test/Nginx/Stream.pm
@@ -110,7 +110,7 @@ sub io {
 		last if defined $read && --$read < 0;
 
 		my $buf = $self->read();
-		last unless length($buf);
+		last unless defined $buf and length($buf);
 
 		$data .= $buf;
 		last if defined $length && length($data) >= $length;