From 7af7d5957d04e8160a4e4e4eb6049c056ec06097 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 1 Jul 2013 18:07:03 +0200 Subject: [PATCH] BUG: counters: third counter was not stored if others unset Commit e25c917a introduced a third tracking counter bug forgot to check it when storing values at the end of the session. The impact is that if neither the first nor the second one are changed, none of them are saved. --- src/session.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/session.c b/src/session.c index ec26522f6..3f117e6df 100644 --- a/src/session.c +++ b/src/session.c @@ -312,8 +312,7 @@ static void kill_mini_session(struct session *s) conn_full_close(s->si[0].conn); s->fe->feconn--; - if (s->stkctr[0].entry || s->stkctr[1].entry) - session_store_counters(s); + session_store_counters(s); if (!(s->listener->options & LI_O_UNLIMITED)) actconn--; @@ -649,8 +648,7 @@ static void session_free(struct session *s) pool_free2(fe->req_cap_pool, txn->req.cap); } - if (s->stkctr[0].entry || s->stkctr[1].entry) - session_store_counters(s); + session_store_counters(s); list_for_each_entry_safe(bref, back, &s->back_refs, users) { /* we have to unlink all watchers. We must not relink them if