From 8a4da022dcaa474048584087d788d2767880ac6d Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 13 Jul 2007 07:27:50 +0000 Subject: [PATCH] Clean all but t_open timestamps to NAN at end of transaction. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1684 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_center.c | 6 +++++- varnish-cache/bin/varnishd/cache_session.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 62ce3914..4a7fec88 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -58,6 +58,7 @@ DOT start -> recv [style=bold,color=green,weight=4] #include #include +#include #include #include #include @@ -196,8 +197,11 @@ cnt_done(struct sess *sp) sp->xid, sp->t_req, sp->t_end, dh, dp, da); sp->xid = 0; - sp->t_open = sp->t_end; SES_Charge(sp); + sp->t_open = sp->t_end; + sp->t_req = NAN; + sp->t_resp = NAN; + sp->t_end = NAN; WSL_Flush(sp->wrk); if (sp->fd >= 0 && sp->doclose != NULL) vca_close_session(sp, sp->doclose); diff --git a/varnish-cache/bin/varnishd/cache_session.c b/varnish-cache/bin/varnishd/cache_session.c index d4efdfb0..ddec49ca 100644 --- a/varnish-cache/bin/varnishd/cache_session.c +++ b/varnish-cache/bin/varnishd/cache_session.c @@ -229,6 +229,7 @@ SES_Charge(struct sess *sp) ses_sum_acct(&sp->acct, a); if (sp->srcaddr != NULL) { + /* XXX: only report once per second ? */ CHECK_OBJ(sp->srcaddr, SRCADDR_MAGIC); LOCK(&sp->srcaddr->sah->mtx); ses_sum_acct(&sp->srcaddr->acct, a); -- 2.39.5