mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-31 00:03:08 +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);
|
nread = fread(&mem[memuse], 1, sizeof(mem)-memuse, local);
|
||||||
if (nread <= 0) {
|
if (nread <= 0) {
|
||||||
/* end of file */
|
/* end of file */
|
||||||
break;
|
if (memuse > 0)
|
||||||
|
/* the previous sending is not finished */
|
||||||
|
nread = 0;
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
memuse += nread;
|
memuse += nread;
|
||||||
total += nread;
|
total += nread;
|
||||||
|
Reference in New Issue
Block a user