mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
sink(): finish waiting for remote EOF after a local error.
We responded to a local error writing out the destination file by going into a mode where we just looped round receiving and throwing away data until our count of the file size reached the file size we expected - but once we were in that mode, we never actually incremented the count!
This commit is contained in:
parent
5d852585a1
commit
7fd8915ce9
8
pscp.c
8
pscp.c
@ -1561,8 +1561,7 @@ int scp_recv_filedata(char *data, int len)
|
|||||||
|
|
||||||
if (xfer_download_data(scp_sftp_xfer, &vbuf, &actuallen)) {
|
if (xfer_download_data(scp_sftp_xfer, &vbuf, &actuallen)) {
|
||||||
if (actuallen <= 0) {
|
if (actuallen <= 0) {
|
||||||
tell_user(stderr, "pscp: %s while reading",
|
tell_user(stderr, "pscp: end of file while reading");
|
||||||
actuallen < 0 ? "error" : "end of file");
|
|
||||||
errs++;
|
errs++;
|
||||||
sfree(vbuf);
|
sfree(vbuf);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1970,8 +1969,10 @@ static void sink(const char *targ, const char *src)
|
|||||||
read = scp_recv_filedata(transbuf, (int)blksize.lo);
|
read = scp_recv_filedata(transbuf, (int)blksize.lo);
|
||||||
if (read <= 0)
|
if (read <= 0)
|
||||||
bump("Lost connection");
|
bump("Lost connection");
|
||||||
if (wrerror)
|
if (wrerror) {
|
||||||
|
received = uint64_add32(received, read);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (write_to_file(f, transbuf, read) != (int)read) {
|
if (write_to_file(f, transbuf, read) != (int)read) {
|
||||||
wrerror = 1;
|
wrerror = 1;
|
||||||
/* FIXME: in sftp we can actually abort the transfer */
|
/* FIXME: in sftp we can actually abort the transfer */
|
||||||
@ -1979,6 +1980,7 @@ static void sink(const char *targ, const char *src)
|
|||||||
printf("\r%-25.25s | %50s\n",
|
printf("\r%-25.25s | %50s\n",
|
||||||
stat_name,
|
stat_name,
|
||||||
"Write error.. waiting for end of file");
|
"Write error.. waiting for end of file");
|
||||||
|
received = uint64_add32(received, read);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (statistics) {
|
if (statistics) {
|
||||||
|
Loading…
Reference in New Issue
Block a user