summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm b/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
index e7645cbd930..3f9366894d1 100644
--- a/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
+++ b/Master/tlpkg/tlperl/lib/Net/FTP/dataconn.pm
@@ -9,7 +9,7 @@ use vars qw(@ISA $timeout $VERSION);
use Net::Cmd;
use Errno;
-$VERSION = '0.11';
+$VERSION = '0.12';
@ISA = qw(IO::Socket::INET);
@@ -27,7 +27,7 @@ sub abort {
return $data->close
if ${*$data}{'net_ftp_eof'};
- # for some reason if we continously open RETR connections and not
+ # for some reason if we continuously open RETR connections and not
# read a single byte, then abort them after a while the server will
# close our connection, this prevents the unexpected EOF on the
# command channel -- GMB
@@ -52,7 +52,8 @@ sub _close {
$data->SUPER::close();
delete ${*$ftp}{'net_ftp_dataconn'}
- if exists ${*$ftp}{'net_ftp_dataconn'}
+ if defined $ftp
+ && exists ${*$ftp}{'net_ftp_dataconn'}
&& $data == ${*$ftp}{'net_ftp_dataconn'};
}
@@ -63,12 +64,14 @@ sub close {
if (exists ${*$data}{'net_ftp_bytesread'} && !${*$data}{'net_ftp_eof'}) {
my $junk;
- $data->read($junk, 1, 0);
+ eval { local($SIG{__DIE__}); $data->read($junk, 1, 0) };
return $data->abort unless ${*$data}{'net_ftp_eof'};
}
$data->_close;
+ return unless defined $ftp;
+
$ftp->response() == CMD_OK
&& $ftp->message =~ /unique file name:\s*(\S*)\s*\)/
&& (${*$ftp}{'net_ftp_unique'} = $1);