Commit 895d0548 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

r31751@cat (orig r1120): phk | 2006-09-23 18:45:26 +0200

 Linux sendfile returns number of bytes written.
 
 Detected by:	Xing Li <xing@litespeedtech.com>
 


git-svn-id: http://www.varnish-cache.org/svn/branches/1.0@1159 d4fa192b-c00b-0410-8231-f00ffab90ce4
parents 54fea337 93f2d312
......@@ -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