r878 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Aug 21 22:23:48 CEST 2006


Author: phk
Date: 2006-08-21 22:23:47 +0200 (Mon, 21 Aug 2006)
New Revision: 878

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
Log:
Make it easier to experiement with acceptors by having a single
pointer to the one in use.



Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-08-21 20:23:14 UTC (rev 877)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-08-21 20:23:47 UTC (rev 878)
@@ -39,6 +39,8 @@
 	NULL,
 };
 
+static struct acceptor *vca_act;
+
 static unsigned		xids;
 static pthread_t 	vca_thread_acct;
 
@@ -171,7 +173,7 @@
 			return;
 		}
 	}
-	vca_acceptors[0]->recycle(sp);
+	vca_act->recycle(sp);
 }
 
 /*--------------------------------------------------------------------*/
@@ -202,10 +204,12 @@
 	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));
 }




More information about the varnish-commit mailing list