1
0
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:
zl liu
2011-05-10 10:16:05 +02:00
committed by Daniel Stenberg
parent ce8f0b29a4
commit 5b66a5f38d

View File

@ -237,6 +237,10 @@ int main(int argc, char *argv[])
nread = fread(&mem[memuse], 1, sizeof(mem)-memuse, local);
if (nread <= 0) {
/* end of file */
if (memuse > 0)
/* the previous sending is not finished */
nread = 0;
else
break;
}
memuse += nread;