r1966 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Sep 20 10:23:21 CEST 2007


Author: phk
Date: 2007-09-20 10:23:21 +0200 (Thu, 20 Sep 2007)
New Revision: 1966

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
Log:
Use VBE_CheckFd() convenience function


Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-09-20 08:22:59 UTC (rev 1965)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-09-20 08:23:21 UTC (rev 1966)
@@ -39,7 +39,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <poll.h>
 
 #include "shmlog.h"
 #include "cache.h"
@@ -203,7 +202,6 @@
 bes_nextfd(struct sess *sp)
 {
 	struct vbe_conn *vc;
-	struct pollfd pfd;
 	struct backend *bp;
 	int reuse = 0;
 	struct bes *bes;
@@ -225,11 +223,7 @@
 		if (vc == NULL)
 			break;
 
-		/* Test the connection for remote close before we use it */
-		pfd.fd = vc->fd;
-		pfd.events = POLLIN;
-		pfd.revents = 0;
-		if (!poll(&pfd, 1, 0)) {
+		if (VBE_CheckFd(vc->fd)) {
 			/* XXX locking of stats */
 			VSL_stats->backend_reuse += reuse;
 			VSL_stats->backend_conn++;




More information about the varnish-commit mailing list