diff options
author | Mystery Man <unknown@mandriva.org> | 2002-08-09 10:26:12 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-08-09 10:26:12 +0000 |
commit | fdd0c69b55f6192d1825eb8ddd95bf2806e626f8 (patch) | |
tree | 01303c8c4445a5828d744737e6c87cb973fafba6 /perl-install/http.pm | |
parent | 9c49e6bfb611d4a73815cfa1a6e6821cd48a9ae2 (diff) | |
download | drakx-fdd0c69b55f6192d1825eb8ddd95bf2806e626f8.tar drakx-fdd0c69b55f6192d1825eb8ddd95bf2806e626f8.tar.gz drakx-fdd0c69b55f6192d1825eb8ddd95bf2806e626f8.tar.bz2 drakx-fdd0c69b55f6192d1825eb8ddd95bf2806e626f8.tar.xz drakx-fdd0c69b55f6192d1825eb8ddd95bf2806e626f8.zip |
This commit was manufactured by cvs2svn to create tag 'V1_1_9_9mdk'.V1_1_9_9mdk
Diffstat (limited to 'perl-install/http.pm')
-rw-r--r-- | perl-install/http.pm | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/perl-install/http.pm b/perl-install/http.pm deleted file mode 100644 index 8d1e8d5de..000000000 --- a/perl-install/http.pm +++ /dev/null @@ -1,42 +0,0 @@ -package http; # $Id$ - -use IO::Socket; -use network; - - -my $sock; - -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 = 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", - "", ""); - - #- skip until empty line - my ($now, $last, $buf, $tmp) = 0; - my $read = sub { sysread($sock, $buf, 1) || die; $tmp .= $buf }; - do { - $last = $now; - &$read; &$read if $buf =~ /\015/; - $now = $buf =~ /\012/; - } until ($now && $last); - - $tmp =~ /^.*\b200\b/ ? $sock : undef; -} - -1; |