Skip to content
Snippets Groups Projects
Commit ba246536 authored by Ian Longden's avatar Ian Longden
Browse files

set to ftp to passive if it fails the first time

parent 16ab7eda
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,7 @@ sub fetch_files {
$uri->host(), $file_path );
}
my $ftp = Net::FTP->new( $uri->host(), 'Debug' => 0, Passive => 1 );
my $ftp = Net::FTP->new( $uri->host(), 'Debug' => 0);
if ( !defined($ftp) ) {
printf( "==> Can not open FTP connection: %s\n", $@ );
return ();
......@@ -119,6 +119,9 @@ sub fetch_files {
$ftp->binary();
if(!$ftp->ls()){
$ftp->pasv(1);
}
foreach my $remote_file ( ( @{ $ftp->ls() } ) ) {
if ( !match_glob( basename( $uri->path() ), $remote_file ) ) {
next;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment