From: Willy Tarreau Date: Fri, 18 Jun 2010 19:03:20 +0000 (+0200) Subject: [MEDIUM] session-counters: automatically update tracked connection count X-Git-Tag: v1.5-dev8~521 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e348793696faa1f86581fda4c1bf5d7820622fef;p=thirdparty%2Fhaproxy.git [MEDIUM] session-counters: automatically update tracked connection count When a session tracks a counter, automatically increase the cumulated connection count. This makes src_updt_conn_cnt() almost useless. In fact it might still be used to update different tables. --- diff --git a/include/proto/session.h b/include/proto/session.h index 0f218bb358..6d5de3abff 100644 --- a/include/proto/session.h +++ b/include/proto/session.h @@ -71,9 +71,16 @@ static inline void session_track_counters(struct session *s, struct stktable *t, s->tracked_table = t; s->tracked_counters = ts; if (ts) { - void *ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR); + void *ptr; + + ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR); if (ptr) stktable_data_cast(ptr, conn_cur)++; + + ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT); + if (ptr) + stktable_data_cast(ptr, conn_cnt)++; + if (tick_isset(t->expire)) ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire)); }