]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Start logging earlier in PSCP and PSFTP.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 11 Feb 2017 00:23:36 +0000 (00:23 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 11 Feb 2017 00:23:36 +0000 (00:23 +0000)
We were missing log messages about the start of the network connection.

pscp.c
psftp.c

diff --git a/pscp.c b/pscp.c
index 25a2a7377e8e4f4984f46b586d71c8b735f08d14..5d8256dfa27c0578d877e9bc3dc64de01e723960 100644 (file)
--- a/pscp.c
+++ b/pscp.c
@@ -514,6 +514,9 @@ static void do_cmd(char *host, char *user, char *cmd)
 
     back = &ssh_backend;
 
+    logctx = log_init(NULL, conf);
+    console_provide_logctx(logctx);
+
     err = back->init(NULL, &backhandle, conf,
                     conf_get_str(conf, CONF_host),
                     conf_get_int(conf, CONF_port),
@@ -521,9 +524,7 @@ static void do_cmd(char *host, char *user, char *cmd)
                     conf_get_int(conf, CONF_tcp_keepalives));
     if (err != NULL)
        bump("ssh_init: %s", err);
-    logctx = log_init(NULL, conf);
     back->provide_logctx(backhandle, logctx);
-    console_provide_logctx(logctx);
     ssh_scp_init();
     if (verbose && realhost != NULL && errs == 0)
        tell_user(stderr, "Connected to %s", realhost);
diff --git a/psftp.c b/psftp.c
index 513f202b674cd81bd22946eca18746aa49e40750..83dec9687b4f70c9fbde22df15b553c8e7342ff3 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2837,6 +2837,9 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
 
     back = &ssh_backend;
 
+    logctx = log_init(NULL, conf);
+    console_provide_logctx(logctx);
+
     err = back->init(NULL, &backhandle, conf,
                     conf_get_str(conf, CONF_host),
                     conf_get_int(conf, CONF_port),
@@ -2846,9 +2849,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
        fprintf(stderr, "ssh_init: %s\n", err);
        return 1;
     }
-    logctx = log_init(NULL, conf);
     back->provide_logctx(backhandle, logctx);
-    console_provide_logctx(logctx);
     while (!back->sendok(backhandle)) {
        if (back->exitcode(backhandle) >= 0)
            return 1;