r1120 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Sat Sep 23 18:45:26 CEST 2006
Author: phk
Date: 2006-09-23 18:45:26 +0200 (Sat, 23 Sep 2006)
New Revision: 1120
Modified:
trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
Linux sendfile returns number of bytes written.
Detected by: Xing Li <xing at litespeedtech.com>
Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2006-09-22 12:37:55 UTC (rev 1119)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2006-09-23 16:45:26 UTC (rev 1120)
@@ -163,10 +163,9 @@
} 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
More information about the varnish-commit
mailing list