mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-13 09:07:33 -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:
5
sftp.c
5
sftp.c
@ -1089,7 +1089,8 @@ int xfer_done(struct fxp_xfer *xfer)
|
||||
|
||||
void xfer_download_queue(struct fxp_xfer *xfer)
|
||||
{
|
||||
while (xfer->req_totalsize < xfer->req_maxsize && !xfer->eof) {
|
||||
while (xfer->req_totalsize < xfer->req_maxsize &&
|
||||
!xfer->eof && !xfer->err) {
|
||||
/*
|
||||
* Queue a new read request.
|
||||
*/
|
||||
@ -1155,6 +1156,8 @@ int xfer_download_gotpkt(struct fxp_xfer *xfer, struct sftp_packet *pktin)
|
||||
#endif
|
||||
} else if (rr->retlen < 0) {
|
||||
/* some error other than EOF; signal it back to caller */
|
||||
xfer_set_error(xfer);
|
||||
rr->complete = -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user