From ce08298cd9d967ac887cae95ef3e723fb60adb31 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 21 Aug 2006 20:23:47 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_acceptor.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)); } -- 2.39.5