Skip to content

Commit

Permalink
connect SSH before starting copy threads in resume transfer
Browse files Browse the repository at this point in the history
The first ssh connection attempt intends to get ssh password/passphrase
for following ssh connections spawned by copy threads (Issue #17 and #18).
  • Loading branch information
upa committed Apr 26, 2024
1 parent a5bca0e commit dd99bc0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,18 @@ int main(int argc, char **argv)
pr_err("mscp_checkpoint_load: %s", priv_get_err());
return -1;
}

if (dryrun)
goto out;

/* create the first ssh connection to get password or
* passphrase. The sftp session over it will be not
* used for resume transfer in actuality. ToDo:
* connectin managemnet should be improved. */
if (mscp_connect(m) < 0) {
pr_err("mscp_connect: %s", priv_get_err());
return -1;
}
}

if (dryrun) {
Expand Down

0 comments on commit dd99bc0

Please sign in to comment.