# HG changeset patch # User Maxim Dounin # Date 1366118910 -14400 # Node ID 3dd8c7acf3adea38bc1ad9f4e71561457cb7b3b1 # Parent c754b1c79efeefa3ecbd27ae8197ec76affacdf0 Tests: fix couple of possible warnings in proxy_upgrade.t. diff --git a/proxy_upgrade.t b/proxy_upgrade.t --- a/proxy_upgrade.t +++ b/proxy_upgrade.t @@ -156,7 +156,7 @@ sub upgrade_connect { while (1) { $buf = upgrade_getline($s); - last unless length $buf; + last unless defined $buf and length $buf; log_in($buf); $got .= $buf; last if $got =~ /\x0d?\x0a\x0d?\x0a$/; @@ -168,7 +168,9 @@ sub upgrade_connect { # make sure next line is "handshaked" - return if upgrade_read($s) ne 'handshaked'; + $buf = upgrade_read($s); + + return if !defined $buf or $buf ne 'handshaked'; return $s; }