mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-12 16:37:20 +00:00
[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:
parent
9a3f849371
commit
e348793696
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user