From ef80e39ba0bde1a7022c864fc092f1b6575449d8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 24 Nov 1999 19:19:34 +0000 Subject: no_comment --- perl-install/http.pm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 perl-install/http.pm (limited to 'perl-install') diff --git a/perl-install/http.pm b/perl-install/http.pm new file mode 100644 index 000000000..fbf6c001c --- /dev/null +++ b/perl-install/http.pm @@ -0,0 +1,30 @@ +package http; + +use IO::Socket; + +use install_any; + + +my $sock; + +sub getFile($) { + local($^W) = 0; + + my ($host, $port, $path) = $ENV{URLPREFIX} =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; + $path .= "/" . install_any::relGetFile($_[0]); + + $sock->close if $sock; + $sock = IO::Socket::INET->new(PeerAddr => $host, + PeerPort => $port || 80, + Proto => 'tcp', + Timeout => 60) or die "can't connect "; + $sock->autoflush; + print $sock join("\015\012" => + "GET $path HTTP/1.0", + "Host: $host" . ($port && ":$port"), + "User-Agent: DrakX/vivelinuxabaszindozs", + "", ""); + $sock; +} + +1; -- cgit v1.2.1