]> err.no Git - varnish/commitdiff
A avoid a time(NULL) call
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 11 Sep 2006 08:53:53 +0000 (08:53 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 11 Sep 2006 08:53:53 +0000 (08:53 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@952 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_pool.c

index 6a52dcaf481533b35ad7b1bf1a035286285d99e2..440f2edec0f4fc88be785f1105becb41a9407c88 100644 (file)
@@ -105,6 +105,7 @@ cnt_done(struct sess *sp)
        sp->vcl = NULL;
 
        clock_gettime(CLOCK_REALTIME, &te);
+       sp->wrk->idle = te.tv_sec;
        dh = cnt_dt(&sp->t_open, &sp->t_req);
        dp = cnt_dt(&sp->t_req, &sp->t_resp);
        da = cnt_dt(&sp->t_resp, &te);
@@ -240,6 +241,7 @@ cnt_first(struct sess *sp)
        int i;
 
        VCA_Prep(sp);
+       sp->wrk->idle = sp->t_open.tv_sec;
        sp->wrk->acct.sess++;
        SES_RefSrcAddr(sp);
        for (;;) {
@@ -594,6 +596,7 @@ cnt_recv(struct sess *sp)
        int done;
 
        clock_gettime(CLOCK_REALTIME, &sp->t_req);
+       sp->wrk->idle = sp->t_req.tv_sec;
        sp->xid = ++xids;
        VSL(SLT_ReqStart, sp->fd, "XID %u", sp->xid);
 
index 09d5a817d90d0b0c95ffbe5a43cdb6c36f7939f4..10c0c7bebcd448a495fac9a478e5344911d0eb81 100644 (file)
@@ -148,7 +148,6 @@ wrk_do_one(struct worker *w)
        if (w->nobjhead != NULL)
                CHECK_OBJ(w->nobjhead, OBJHEAD_MAGIC);
        w->wrq = NULL;
-       w->idle = time(NULL);
        LOCK(&wrk_mtx);
        VSL_stats->n_wrk_busy--;
 }