Mailing List Archive

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

Modified:
branches/1.0/
branches/1.0/bin/varnishd/cache_pipe.c
Log:
r31764 at cat (orig r1133): phk | 2006-09-29 20:37:02 +0200
Don't suffer if one side of a piped connection keeps blasting away.




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

Modified: branches/1.0/bin/varnishd/cache_pipe.c
===================================================================
--- branches/1.0/bin/varnishd/cache_pipe.c 2006-10-18 14:26:57 UTC (rev 1171)
+++ branches/1.0/bin/varnishd/cache_pipe.c 2006-10-18 14:26:59 UTC (rev 1172)
@@ -49,7 +49,7 @@
char buf[BUFSIZ];

i = read(fds[idx].fd, buf, sizeof buf);
- if (i <= 0) {
+ if (i <= 0 || fds[1-idx].events == 0) {
VSL(SLT_Debug, fds[idx].fd, "Pipe Shut read(read)");
VSL(SLT_Debug, fds[1-idx].fd, "Pipe Shut write(read)");
shutdown(fds[idx].fd, SHUT_RD);