Module: kamailio
Branch: master
Commit: b8062321572e1523bb9478fd2421c5a8bc8314af
URL:
https://github.com/kamailio/kamailio/commit/b8062321572e1523bb9478fd2421c5a…
Author: Bastian Triller <bastian.triller(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-01-06T13:18:45+01:00
htable: Fix de-/increment w/ auto expire
Update item expiration value during de-/incrementation for htables that
are configured with autoexpire and updateexpire disabled.
Otherwise an item cannot be used until timer cleaned it up.
---
Modified: src/modules/htable/ht_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b8062321572e1523bb9478fd2421c5a…
Patch:
https://github.com/kamailio/kamailio/commit/b8062321572e1523bb9478fd2421c5a…
---
diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 559ee9784d2..9190dd310ff 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -743,6 +743,10 @@ ht_cell_t *ht_cell_value_add(ht_t *ht, str *name, int val, ht_cell_t
*old)
if(now > 0 && it->expire != 0 && it->expire < now) {
/* entry has expired */
+ it->expire = ht->htexpire;
+ if(it->expire) {
+ it->expire += now;
+ }
if(ht->flags == PV_VAL_INT) {
/* initval is integer, use it to create a fresh entry */
it->flags &= ~AVP_VAL_STR;