From: phk Date: Mon, 21 Aug 2006 20:23:47 +0000 (+0000) Subject: Make it easier to experiement with acceptors by having a single X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce08298cd9d967ac887cae95ef3e723fb60adb31;p=varnish Make it easier to experiement with acceptors by having a single pointer to the one in use. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@878 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 9051eca1..39ee6975 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -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)); }