[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.
This commit is contained in:
Willy Tarreau 2010-06-18 21:03:20 +02:00
parent 9a3f849371
commit e348793696

View File

@ -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));
}