summaryrefslogtreecommitdiffstats
path: root/perl-install/http.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/http.pm')
-rw-r--r--perl-install/http.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/perl-install/http.pm b/perl-install/http.pm
index 8899317b8..48c89d4f7 100644
--- a/perl-install/http.pm
+++ b/perl-install/http.pm
@@ -28,15 +28,15 @@ sub getFile {
#- skip until empty line
local $_;
- my ($now, $last) = 0;
+ my ($now, $last, $tmp) = 0;
+ my $read = sub { sysread($sock, $_, 1) || die; $tmp .= $_ };
do {
$last = $now;
- sysread($sock, $_, 1) || die;
- sysread($sock, $_, 1) || die if /\015/;
+ &$read; &$read if /\015/;
$now = /\012/;
} until ($now && $last);
- $sock;
+ $tmp =~ /^.*\b200\b/ ? $sock : undef;
}
1;