summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-10 18:37:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-10 18:37:37 +0000
commit99aece0e3cda07180acff00156c90f1051228d75 (patch)
tree4abc29a1f5082687d71b6ac510c837a46a70a2b1
parenteb33adf7f7e934e4d6938d5939d9a223810aa07c (diff)
downloaddrakx-backup-do-not-use-99aece0e3cda07180acff00156c90f1051228d75.tar
drakx-backup-do-not-use-99aece0e3cda07180acff00156c90f1051228d75.tar.gz
drakx-backup-do-not-use-99aece0e3cda07180acff00156c90f1051228d75.tar.bz2
drakx-backup-do-not-use-99aece0e3cda07180acff00156c90f1051228d75.tar.xz
drakx-backup-do-not-use-99aece0e3cda07180acff00156c90f1051228d75.zip
don't let Timeout kill us
-rw-r--r--perl-install/ftp.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm
index 20b837b8c..c84ce66a6 100644
--- a/perl-install/ftp.pm
+++ b/perl-install/ftp.pm
@@ -53,7 +53,8 @@ sub getFile {
$f eq 'XXX' and rewindGetFile(), return; #- special case to force closing connection.
foreach (1..3) {
my ($ftp, $retr) = new(@para ? @para : fromEnv);
- $$retr->close if $$retr;
+ eval { $$retr->close if $$retr };
+ $@ and rewindGetFile(); #- in case Timeout got us on "->close"
$$retr = $ftp->retr($f) and return $$retr;
($ftp->code == 550) and log::l("FTP: 550 file unavailable"), return;
rewindGetFile();
@@ -75,8 +76,9 @@ sub rewindGetFile() {
#- close any existing connection.
foreach (values %hosts) {
my ($ftp, $retr) = @{$_ || []};
- $$retr->close if $$retr;
- $ftp->close() if $ftp;
+ #- don't let Timeout kill us!
+ eval { $$retr->close } if $$retr;
+ eval { $ftp->close } if $ftp;
}
#- make sure to reconnect to server.