[MEDIUM] session counters: automatically remove expired entries.
When a ref_cnt goes down to zero and the entry is expired, remove it.
diff --git a/include/proto/session.h b/include/proto/session.h
index 0959320..bf390ca 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -60,6 +60,7 @@
if (ptr)
stktable_data_cast(ptr, conn_cur)--;
s->be_tracked_counters->ref_cnt--;
+ stksess_kill_if_expired(s->be_tracked_table, s->be_tracked_counters);
s->be_tracked_counters = NULL;
}
@@ -68,6 +69,7 @@
if (ptr)
stktable_data_cast(ptr, conn_cur)--;
s->fe_tracked_counters->ref_cnt--;
+ stksess_kill_if_expired(s->fe_tracked_table, s->fe_tracked_counters);
s->fe_tracked_counters = NULL;
}
}
@@ -87,6 +89,7 @@
if (ptr)
stktable_data_cast(ptr, conn_cur)--;
s->be_tracked_counters->ref_cnt--;
+ stksess_kill_if_expired(s->be_tracked_table, s->be_tracked_counters);
s->be_tracked_counters = NULL;
}