]> err.no Git - varnish/commitdiff
Keep track of how many connections we have open
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 May 2006 12:27:30 +0000 (12:27 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 May 2006 12:27:30 +0000 (12:27 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@161 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend.c

index c75e0aeceac94576d4494a967116dbe4cd2de1b0..a00cb0b96618357adb7ccb0fcaf7ac667921dafa 100644 (file)
@@ -133,6 +133,7 @@ vbe_rdp(int fd, short event __unused, void *arg __unused)
        AZ(pthread_mutex_lock(&vbemtx));
        TAILQ_REMOVE(&vc->vbe->bconn, vc, list);
        if (vc->fd < 0) {
+               vc->vbe->nconn--;
                free(vc);
        } else {
                vc->inuse = 0;
@@ -236,6 +237,7 @@ VBE_GetFd(struct backend *bp, void **ptr)
                vc->fd = -1;
                vc->inuse = 1;
                TAILQ_INSERT_TAIL(&vp->bconn, vc, list);
+               vp->nconn++;
                AZ(pthread_mutex_unlock(&vbemtx));
                connect_to_backend(vc, bp);
                event_set(&vc->ev, vc->fd, EV_READ | EV_PERSIST, vbe_rdf, vc);