[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/src/stick_table.c b/src/stick_table.c
index ccfd7b5..78a0df7 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -43,6 +43,19 @@
}
/*
+ * Kill an stksess (only if its ref_cnt is zero).
+ */
+void stksess_kill(struct stktable *t, struct stksess *ts)
+{
+ if (ts->ref_cnt)
+ return;
+
+ eb32_delete(&ts->exp);
+ ebmb_delete(&ts->key);
+ stksess_free(t, ts);
+}
+
+/*
* Initialize or update the key in the sticky session <ts> present in table <t>
* from the value present in <key>.
*/