From dd99bc0ac9ffb3055924281d848fafc9a0f40d54 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Thu, 25 Apr 2024 13:20:18 +0900 Subject: [PATCH] connect SSH before starting copy threads in resume transfer The first ssh connection attempt intends to get ssh password/passphrase for following ssh connections spawned by copy threads (Issue #17 and #18). --- src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.c b/src/main.c index de53e30..6aa465a 100644 --- a/src/main.c +++ b/src/main.c @@ -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) {