[sr-dev] git:master: htable: check for expired records only for tables with auto-expire set

Elena-Ramona Modroiu ramona at rosdev.ro
Fri Mar 9 12:35:29 CET 2012


Module: sip-router
Branch: master
Commit: 1f5b0632e02e29b304c3d848b2df94ab8e514745
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f5b0632e02e29b304c3d848b2df94ab8e514745

Author: Elena-Ramona Modroiu <ramona at asipto.com>
Committer: Elena-Ramona Modroiu <ramona at asipto.com>
Date:   Fri Mar  9 12:34:27 2012 +0100

htable: check for expired records only for tables with auto-expire set

- from a patch by Krishna Kurapati

---

 modules_k/htable/ht_db.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules_k/htable/ht_db.c b/modules_k/htable/ht_db.c
index e1a46b2..4c6fbdf 100644
--- a/modules_k/htable/ht_db.c
+++ b/modules_k/htable/ht_db.c
@@ -369,10 +369,12 @@ int ht_db_save_table(ht_t *ht, str *dbtable)
 					it->name.len, it->name.s, it->value.n);
 			}
 
-			if (it->expire <= now) {
-				LM_DBG("skipping expired entry");
-				it = it->next;
-				continue;
+			if(ht->htexpire > 0) {
+				if (it->expire <= now) {
+					LM_DBG("skipping expired entry");
+					it = it->next;
+					continue;
+				}
 			}
 
 			db_vals[0].type = DB1_STR;




More information about the sr-dev mailing list