X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sftp.c;h=a55262a7ced228b66bdcc732f848754a60657f95;hb=ac61490a5b9f40a3655d363d5a1014112aae7222;hp=4d5172b58da21489ef2e00434faadda8d6b05ba7;hpb=77cc3018626450f06de853d94e12f4cd800241dc;p=PuTTY.git diff --git a/sftp.c b/sftp.c index 4d5172b5..a55262a7 100644 --- a/sftp.c +++ b/sftp.c @@ -334,6 +334,14 @@ static struct sftp_request *sftp_alloc_request(void) return r; } +void sftp_cleanup_request(void) +{ + if (sftp_requests == NULL) { + freetree234(sftp_requests); + sftp_requests = NULL; + } +} + void sftp_register(struct sftp_request *req) { req->registered = 1; @@ -1081,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. */ @@ -1147,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; }