From: simon Date: Sat, 26 Aug 2006 10:17:39 +0000 (+0000) Subject: On cleanup, PSCP and PSFTP should explicitly check that the back end X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/34580230cecf68453395e5698bb0176ab473748f?hp=95587c73731bf686583ca49d6cc9f3157aa5e527 On cleanup, PSCP and PSFTP should explicitly check that the back end 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 --- diff --git a/pscp.c b/pscp.c index a906303b..5f22828a 100644 --- 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 2a74bcd2..db3ae7f5 100644 --- 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 */ }