]> err.no Git - varnish/commitdiff
Make it easier to experiement with acceptors by having a single
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Aug 2006 20:23:47 +0000 (20:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 21 Aug 2006 20:23:47 +0000 (20:23 +0000)
pointer to the one in use.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@878 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c

index 9051eca1a73968db1853071438bfc61e27395d4a..39ee69753f4806a95eb7085174fee011490b419a 100644 (file)
@@ -39,6 +39,8 @@ static struct acceptor *vca_acceptors[] = {
        NULL,
 };
 
+static struct acceptor *vca_act;
+
 static unsigned                xids;
 static pthread_t       vca_thread_acct;
 
@@ -171,7 +173,7 @@ vca_return_session(struct sess *sp)
                        return;
                }
        }
-       vca_acceptors[0]->recycle(sp);
+       vca_act->recycle(sp);
 }
 
 /*--------------------------------------------------------------------*/
@@ -202,10 +204,12 @@ VCA_Init(void)
        xids = random();
 
        /* XXX: Add selector mechanism at some point */
-       if (vca_acceptors[0]->name == NULL) {
+       vca_act = vca_acceptors[0];
+
+       if (vca_act->name == NULL) {
                fprintf(stderr, "No acceptor in program\n");
                exit (2);
        }
-       vca_acceptors[0]->init();
+       vca_act->init();
        AZ(pthread_create(&vca_thread_acct, NULL, vca_acct, NULL));
 }