diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-11-24 19:19:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-11-24 19:19:34 +0000 |
commit | ef80e39ba0bde1a7022c864fc092f1b6575449d8 (patch) | |
tree | 1b3d10aa3f8561ac8ae2f4540fe931a80759531c /perl-install/http.pm | |
parent | 044024d3adcb8cb19fec8d36cbd7d500f3b36ab9 (diff) | |
download | drakx-backup-do-not-use-ef80e39ba0bde1a7022c864fc092f1b6575449d8.tar drakx-backup-do-not-use-ef80e39ba0bde1a7022c864fc092f1b6575449d8.tar.gz drakx-backup-do-not-use-ef80e39ba0bde1a7022c864fc092f1b6575449d8.tar.bz2 drakx-backup-do-not-use-ef80e39ba0bde1a7022c864fc092f1b6575449d8.tar.xz drakx-backup-do-not-use-ef80e39ba0bde1a7022c864fc092f1b6575449d8.zip |
no_comment
Diffstat (limited to 'perl-install/http.pm')
-rw-r--r-- | perl-install/http.pm | 30 |
1 files changed, 30 insertions, 0 deletions
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; |