From 46b954116f8349476ff9d4c200eea79d9388d960 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 11 Sep 2006 08:53:53 +0000 Subject: [PATCH] A avoid a time(NULL) call git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@952 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_center.c | 3 +++ varnish-cache/bin/varnishd/cache_pool.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 6a52dcaf..440f2ede 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -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); diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 09d5a817..10c0c7be 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -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--; } -- 2.39.5