r2057 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Sep 30 21:42:08 CEST 2007


Author: phk
Date: 2007-09-30 21:42:08 +0200 (Sun, 30 Sep 2007)
New Revision: 2057

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pipe.c
Log:
Set the poll'ed fd to -1 when we halfclose the fd to avoid
an infinite loop on certain OS's.


Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c	2007-09-29 20:53:53 UTC (rev 2056)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c	2007-09-30 19:42:08 UTC (rev 2057)
@@ -52,6 +52,7 @@
 	if (i <= 0 || fds[1-idx].events == 0) {
 		AZ(shutdown(fds[idx].fd, SHUT_RD));
 		AZ(shutdown(fds[1-idx].fd, SHUT_WR));
+		fds[idx].fd = -1;
 		fds[idx].events = 0;
 		return;
 	}
@@ -60,6 +61,7 @@
 		if (j != i) {
 			AZ(shutdown(fds[idx].fd, SHUT_WR));
 			AZ(shutdown(fds[1-idx].fd, SHUT_RD));
+			fds[1-idx].fd = -1;
 			fds[1-idx].events = 0;
 			return;
 		}




More information about the varnish-commit mailing list