]> err.no Git - varnish/commitdiff
Use VBE_CheckFd() convenience function
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 08:23:21 +0000 (08:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 20 Sep 2007 08:23:21 +0000 (08:23 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1966 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend_simple.c

index ffb71547118044ab9be5c0fb466a4ef2ad736801..b7e9c143f00dfa756e85f1a7062527890acf5d5c 100644 (file)
@@ -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 @@ static struct vbe_conn *
 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 @@ bes_nextfd(struct sess *sp)
                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++;