sftp_write_sliding: send the complete file
When reaching the end of file there can still be data left not sent.
This commit is contained in:
parent
ce8f0b29a4
commit
5b66a5f38d
@ -237,7 +237,11 @@ int main(int argc, char *argv[])
|
||||
nread = fread(&mem[memuse], 1, sizeof(mem)-memuse, local);
|
||||
if (nread <= 0) {
|
||||
/* end of file */
|
||||
break;
|
||||
if (memuse > 0)
|
||||
/* the previous sending is not finished */
|
||||
nread = 0;
|
||||
else
|
||||
break;
|
||||
}
|
||||
memuse += nread;
|
||||
total += nread;
|
||||
|
Loading…
Reference in New Issue
Block a user