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,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;