for (my $pass=0; $pass < $_max_retries; $pass++) { if ($connect->put($local, $remote, %$options)) { my $stat = $connect->stat($remote); $size = $stat->size; main::add2Log(" Finished $size of $lsize bytes", 'info') if ($main::debug >= 1 and $pass); $main::progressBar = 100; return 1; } main::append2Log("\b"x$_fll, ' 'x$_fll, "\b"x$_fll) unless (main::is_graphical()); emit(" Error: " . $connect->status . ' (' . $connect->error . ')', " Resuming transfer (retry " . ($pass+1) . ')'); my $connect = sshConnect($url, $user, $password, 'sftp', undef, 1, 1); return undef unless ($connect); }