Module: kamailio
Branch: master
Commit: d92a990a4040279ed7ee4d71debf2a13fd4d6782
URL:
https://github.com/kamailio/kamailio/commit/d92a990a4040279ed7ee4d71debf2a1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-12-20T08:19:14+01:00
htable: skip expired items for pv counting them
- GH #4080
---
Modified: src/modules/htable/ht_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d92a990a4040279ed7ee4d71debf2a1…
Patch:
https://github.com/kamailio/kamailio/commit/d92a990a4040279ed7ee4d71debf2a1…
---
diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 8655c2bf443..45eda69e359 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -1660,6 +1660,11 @@ int ht_count_cells_re(str *sre, ht_t *ht, int mode)
ht_slot_lock(ht, i);
it = ht->entries[i].first;
while(it) {
+ if(ht->htexpire > 0 && it->expire != 0 && it->expire <
time(NULL)) {
+ /* entry has expired, continue */
+ it = it->next;
+ continue;
+ }
it0 = it->next;
if(op == 5) {
if(!(it->flags & AVP_VAL_STR))