We must not fall back to the old way (read-write)

if sendfile() transferred some data before throwing
a error condition because sendfile() won't move the
file offset for read() to start from.

MFC after:	2 weeks
This commit is contained in:
yar 2004-10-15 09:51:36 +00:00
parent fedc64eac9
commit 9a27d52ecc

View File

@ -2058,7 +2058,7 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg)
filesize -= cnt;
if (err == -1) {
if (!cnt)
if (cnt == 0 && offset == 0)
goto oldway;
goto data_err;