r952 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Sep 11 10:53:53 CEST 2006


Author: phk
Date: 2006-09-11 10:53:53 +0200 (Mon, 11 Sep 2006)
New Revision: 952

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
A avoid a time(NULL) call


Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2006-09-11 08:42:35 UTC (rev 951)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2006-09-11 08:53:53 UTC (rev 952)
@@ -105,6 +105,7 @@
 	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 @@
 	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 @@
 	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);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-11 08:42:35 UTC (rev 951)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-11 08:53:53 UTC (rev 952)
@@ -148,7 +148,6 @@
 	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--;
 }




More information about the varnish-commit mailing list