]> err.no Git - varnish/commitdiff
Reduce number of TIM_real() calls slightly in multi socket case.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 16 Oct 2007 09:03:18 +0000 (09:03 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 16 Oct 2007 09:03:18 +0000 (09:03 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2100 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c

index 501a5cf5dab42a023aa4abcc967c6c78092b07ee..9c40c707a4770d93ce5677d64621395a25ed951b 100644 (file)
@@ -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;