xfer_download_data could return actuallen as either 0 or -1 to
indicate EOF. Now it's always 0, and scp_recv_filedata actually checks
for that case and reports an error.
}
if (xfer_download_data(scp_sftp_xfer, &vbuf, &actuallen)) {
+ if (actuallen <= 0) {
+ tell_user(stderr, "pscp: %s while reading",
+ actuallen < 0 ? "error" : "end of file");
+ errs++;
+ sfree(vbuf);
+ return -1;
+ }
/*
* This assertion relies on the fact that the natural
* block size used in the xfer manager is at most that
if ((rr->retlen < 0 && fxp_error_type()==SSH_FX_EOF) || rr->retlen == 0) {
xfer->eof = TRUE;
+ rr->retlen = 0;
rr->complete = -1;
#ifdef DEBUG_DOWNLOAD
printf("setting eof\n");