mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-19 03:51:02 -05:00
The xfer mechanism wasn't gracefully terminating when an error was
encountered part way through transfer. In particular, this caused psftp to hang (waiting for FXP_READ replies which had already arrived) if you try `get' (without -r) on a remote directory. [originally from svn r5005]
This commit is contained in:
7
psftp.c
7
psftp.c
@ -201,7 +201,7 @@ int sftp_get_file(char *fname, char *outfname, int recurse, int restart,
|
||||
struct fxp_xfer *xfer;
|
||||
uint64 offset;
|
||||
FILE *fp;
|
||||
int ret;
|
||||
int ret, shown_err = FALSE;
|
||||
|
||||
/*
|
||||
* In recursive mode, see if we're dealing with a directory.
|
||||
@ -443,7 +443,10 @@ int sftp_get_file(char *fname, char *outfname, int recurse, int restart,
|
||||
ret = xfer_download_gotpkt(xfer, pktin);
|
||||
|
||||
if (ret < 0) {
|
||||
printf("error while reading: %s\n", fxp_error());
|
||||
if (!shown_err) {
|
||||
printf("error while reading: %s\n", fxp_error());
|
||||
shown_err = TRUE;
|
||||
}
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user