r2100 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Oct 16 11:03:18 CEST 2007


Author: phk
Date: 2007-10-16 11:03:18 +0200 (Tue, 16 Oct 2007)
New Revision: 2100

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
Log:
Reduce number of TIM_real() calls slightly in multi socket case.


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2007-10-16 09:00:48 UTC (rev 2099)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2007-10-16 09:03:18 UTC (rev 2100)
@@ -138,6 +138,7 @@
 	struct pollfd *pfd;
 	struct listen_sock *ls;
 	unsigned u;
+	double now;
 
 	(void)arg;
 
@@ -171,6 +172,7 @@
 				    &tv_rcvtimeo, sizeof tv_rcvtimeo));
 		}
 		i = poll(pfd, heritage.nsocks, 1000);
+		now = TIM_real();
 		for (u = 0; u < heritage.nsocks; u++) {
 			if (pfd[u].revents == 0)
 				continue;
@@ -191,7 +193,7 @@
 
 			sp->fd = i;
 			sp->id = i;
-			sp->t_open = TIM_real();
+			sp->t_open = now;
 
 			HTC_Init(sp->htc, sp->ws, sp->fd);
 			sp->step = STP_FIRST;




More information about the varnish-commit mailing list