From 3e0b5e071bc323f22471bb656da473b919048d3f Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 21 Aug 2007 09:23:31 +0000 Subject: [PATCH] Make sure wrk->used is always set when we park on an object, we might be unlucky multiple times in which case the responsibility falls back to cnt_lookup(). Fixes 144. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1913 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_center.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index f8fe5179..3650e3e7 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -524,7 +524,12 @@ cnt_lookup(struct sess *sp) */ WSL(sp->wrk, SLT_Debug, sp->fd, "on waiting list on obj %u", sp->obj->xid); - assert(!isnan(sp->wrk->used)); + /* + * There is a non-zero risk that we come here more than once + * before we get through, in that case cnt_recv must be set + */ + if (isnan(sp->wrk->used)) + sp->wrk->used = TIM_real(); SES_Charge(sp); return (1); } -- 2.39.5