comparison lib/Test/Nginx/Stream.pm @ 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 d2cb9ed7412e
children 25a4b2fdd3fb
comparison
equal deleted inserted replaced
874:66b8e350b9c8 875:c380b4b7e2e4
108 $data = ''; 108 $data = '';
109 while (1) { 109 while (1) {
110 last if defined $read && --$read < 0; 110 last if defined $read && --$read < 0;
111 111
112 my $buf = $self->read(); 112 my $buf = $self->read();
113 last unless length($buf); 113 last unless defined $buf and length($buf);
114 114
115 $data .= $buf; 115 $data .= $buf;
116 last if defined $length && length($data) >= $length; 116 last if defined $length && length($data) >= $length;
117 } 117 }
118 118