Module: kamailio
Branch: master
Commit: d92a990a4040279ed7ee4d71debf2a13fd4d6782
URL: 
https://github.com/kamailio/kamailio/commit/d92a990a4040279ed7ee4d71debf2a13fd4d6782

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@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/d92a990a4040279ed7ee4d71debf2a13fd4d6782.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d92a990a4040279ed7ee4d71debf2a13fd4d6782.patch

---

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))

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to