Commit f058ac9e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Linux sendfile returns number of bytes written.

Detected by:	Xing Li <xing@litespeedtech.com>


git-svn-id: http://www.varnish-cache.org/svn/trunk@1120 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 175fc956
......@@ -163,10 +163,9 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len)
} while (0);
#elif defined(__linux__)
do {
if (WRK_Flush(w) == 0) {
if (sendfile(*w->wfd, fd, &off, len) != 0)
w->werr++;
}
if (WRK_Flush(w) == 0 &&
sendfile(*w->wfd, fd, &off, len) != len)
w->werr++;
} while (0);
#else
#error Unknown sendfile() implementation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment