From 1a1cced2ae0c2fe498eff4202fd377788229a434 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 16 Oct 2007 09:03:18 +0000 Subject: [PATCH] Reduce number of TIM_real() calls slightly in multi socket case. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2100 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 501a5cf5..9c40c707 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -138,6 +138,7 @@ vca_acct(void *arg) struct pollfd *pfd; struct listen_sock *ls; unsigned u; + double now; (void)arg; @@ -171,6 +172,7 @@ vca_acct(void *arg) &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 @@ vca_acct(void *arg) 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; -- 2.39.5