Patch from Tim Kosse: check back->exitcode() in both loops on
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 6 Jul 2008 12:24:56 +0000 (12:24 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 6 Jul 2008 12:24:56 +0000 (12:24 +0000)
ssh_sftp_loop_iteration(), not just one. Fixes exiting on a negative
response to the host key confirmation prompt on Windows (because
winsftp.c doesn't have the equivalent of uxsftp.c's no_fds_ok); on
Unix it worked already but gave a suboptimal error message, which is
fixed too by this patch.

git-svn-id: svn://svn.tartarus.org/sgt/putty@8110 cda61777-01e9-0310-a592-d414129be87e

psftp.c

diff --git a/psftp.c b/psftp.c
index 2e25d97..cb5add3 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2798,6 +2798,8 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
     back->provide_logctx(backhandle, logctx);
     console_provide_logctx(logctx);
     while (!back->sendok(backhandle)) {
+       if (back->exitcode(backhandle) >= 0)
+           return 1;
        if (ssh_sftp_loop_iteration() < 0) {
            fprintf(stderr, "ssh_init: error during SSH connection setup\n");
            return 1;