diff options
| author | Daouda Lo <daouda@mandriva.com> | 2002-03-14 10:06:49 +0000 |
|---|---|---|
| committer | Daouda Lo <daouda@mandriva.com> | 2002-03-14 10:06:49 +0000 |
| commit | 6a7a81e53170d9a2b785efa8e953977dc6dddb62 (patch) | |
| tree | fb2a1973bc87eee990fba226f7e3d4a91b0364c4 /http.pm | |
| parent | 6cd4b2ac8899ced4c5eb4ea67eab54c8f60eb1f2 (diff) | |
| download | mgaonline-6a7a81e53170d9a2b785efa8e953977dc6dddb62.tar mgaonline-6a7a81e53170d9a2b785efa8e953977dc6dddb62.tar.gz mgaonline-6a7a81e53170d9a2b785efa8e953977dc6dddb62.tar.bz2 mgaonline-6a7a81e53170d9a2b785efa8e953977dc6dddb62.tar.xz mgaonline-6a7a81e53170d9a2b785efa8e953977dc6dddb62.zip | |
removed http ftp crypto
Diffstat (limited to 'http.pm')
| -rw-r--r-- | http.pm | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/http.pm b/http.pm deleted file mode 100644 index 8d1e8d5d..00000000 --- a/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; |
