mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user