From aa560937696c59232dfdf00f3b493b8f85bf412a Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Fri, 4 Jan 2002 16:41:45 +0000 Subject: added update installation support to install (big modifs need testing). --- perl-install/http.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'perl-install/http.pm') diff --git a/perl-install/http.pm b/perl-install/http.pm index 057764a27..8d1e8d5de 100644 --- a/perl-install/http.pm +++ b/perl-install/http.pm @@ -10,15 +10,16 @@ sub getFile { local($^W) = 0; my ($url) = @_; + $sock->close if $sock; + $url =~ m|/XXX$| and return; #- force closing connection. + my ($host, $port, $path) = $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; $host = network::resolv($host); - $sock->close if $sock; - $url =~ m|/XXX$| and return; #- force closing connection. $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port || 80, Proto => 'tcp', - Timeout => 60) or die "can't connect "; + Timeout => 60) or die "can't connect $@"; $sock->autoflush; print $sock join("\015\012" => "GET $path HTTP/1.0", -- cgit v1.2.1