Mailing List Archive

r1159 - in branches/1.0: . bin/varnishd
Author: des
Date: 2006-10-18 16:26:41 +0200 (Wed, 18 Oct 2006)
New Revision: 1159

Modified:
branches/1.0/
branches/1.0/bin/varnishd/cache_pool.c
Log:
r31751 at cat (orig r1120): phk | 2006-09-23 18:45:26 +0200
Linux sendfile returns number of bytes written.

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




Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
- d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1119
+ d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1120

Modified: branches/1.0/bin/varnishd/cache_pool.c
===================================================================
--- branches/1.0/bin/varnishd/cache_pool.c 2006-10-18 14:26:40 UTC (rev 1158)
+++ branches/1.0/bin/varnishd/cache_pool.c 2006-10-18 14:26:41 UTC (rev 1159)
@@ -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