File mirror-2.9.ftp-ls-timeout.patch of Package mirror.9822
diff -urN mirror-2.9.old/ftp.pl mirror-2.9/ftp.pl
--- mirror-2.9.old/ftp.pl 2017-01-31 14:31:19.917551342 +0100
+++ mirror-2.9/ftp.pl 2017-01-31 14:31:44.777631533 +0100
@@ -270,6 +270,13 @@
$SIG{ 'PIPE' } = "ftp'ftp__sighandler";
}
+# Setup a signal handler for user interrupts.
+sub ftp'set_user_signals
+{
+ $ftp_logger = @_;
+ $SIG{ 'INT' } = "ftp'ftp__sighandler";
+}
+
# &ftp'set_namemap( function to map outgoing name, function to map incoming )
sub ftp'set_namemap
{
@@ -279,7 +286,6 @@
}
}
-
# &ftp'open( hostname or address,
# port to use,
# retry on call failure,
@@ -581,6 +587,9 @@
return 0;
}
+ # shut down our end of the socket
+ &close_data_socket;
+
# read the close
#
$ret = &expect($timeout,
@@ -590,9 +599,6 @@
$ret = 0;
}
- # shut down our end of the socket
- &close_data_socket;
-
if( ! $ret ){
return 0;
}