From 5765f8ceb923359085cdbdb6eea3b58c8ae9484d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 26 Aug 2006 10:17:39 +0000 Subject: [PATCH] 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. [originally from svn r6803] --- pscp.c | 2 +- psftp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 */ }