summaryrefslogtreecommitdiffstats
path: root/perl-install/crypto.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-16 20:58:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-16 20:58:21 +0000
commit4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf (patch)
treeca197b89540266dd467c1c5730c8727ec7834c69 /perl-install/crypto.pm
parentab936ab47f2bdb575c75a550594ba30a7c261bde (diff)
downloaddrakx-4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf.tar
drakx-4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf.tar.gz
drakx-4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf.tar.bz2
drakx-4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf.tar.xz
drakx-4ef23f4fdfcddd9c110af5cf4ec76cbf64164fdf.zip
(mirrors): add a timeout via "alarm" (needs testing)
Diffstat (limited to 'perl-install/crypto.pm')
-rw-r--r--perl-install/crypto.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index 60bd216d5..6ca002d0f 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -57,6 +57,9 @@ sub mirrors {
#- http://www.linux-mandrake.com/mirrorsfull.list
require http;
my $f = http::getFile("http://www.linux-mandrake.com/mirrorsfull.list");
+
+ local $SIG{ALRM} = sub { die "timeout" };
+ alarm 60;
foreach (<$f>) {
my ($arch, $url, $dir) = m|updates([^:]*):ftp://([^/]*)(/\S*)| or next;
MDK::Common::System::compat_arch($arch) or
@@ -69,6 +72,7 @@ sub mirrors {
$mirrors{$url} = [ $land, $dir ];
}
http::getFile('/XXX'); #- close connection.
+ alarm 0;
#- now add static mirror (in case of something wrong happened above).
add2hash(\%mirrors, \%static_mirrors);