On cleanup, PSCP and PSFTP should explicitly check that the back end
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 26 Aug 2006 10:17:39 +0000 (10:17 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 26 Aug 2006 10:17:39 +0000 (10:17 +0000)
is still running rather than relying on ssh_sftp_loop_iteration() to
return a bogus value.

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

pscp.c
psftp.c

diff --git a/pscp.c b/pscp.c
index a906303..5f22828 100644 (file)
--- a/pscp.c
+++ b/pscp.c
@@ -245,7 +245,7 @@ static int ssh_scp_recv(unsigned char *buf, int len)
     }
 
     while (outlen > 0) {
-       if (ssh_sftp_loop_iteration() < 0)
+       if (back->exitcode(backhandle) >= 0 || ssh_sftp_loop_iteration() < 0)
            return 0;                  /* doom */
     }
 
diff --git a/psftp.c b/psftp.c
index 2a74bcd..db3ae7f 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2567,7 +2567,7 @@ int sftp_recvdata(char *buf, int len)
     }
 
     while (outlen > 0) {
-       if (ssh_sftp_loop_iteration() < 0)
+       if (back->exitcode(backhandle) >= 0 || ssh_sftp_loop_iteration() < 0)
            return 0;                  /* doom */
     }