[sr-dev] git:master: uac: clean old records in timer callback after a while from a reload

Daniel-Constantin Mierla miconda at gmail.com
Tue Jul 22 17:35:25 CEST 2014


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Jul 22 13:42:54 2014 +0200

uac: clean old records in timer callback after a while from a reload

---

 modules/uac/uac_reg.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/uac/uac_reg.c b/modules/uac/uac_reg.c
index f1344be..0950557 100644
--- a/modules/uac/uac_reg.c
+++ b/modules/uac/uac_reg.c
@@ -966,6 +966,15 @@ void uac_reg_timer(unsigned int ticks)
 			it = it->next;
 		}
 	}
+
+	if(_reg_htable_gc!=NULL)
+	{
+		lock_get(_reg_htable_gc_lock);
+		if(_reg_htable_gc->stime!=0
+				&& _reg_htable_gc->stime < tn - UAC_REG_GC_INTERVAL)
+			uac_reg_reset_ht_gc();
+		lock_release(_reg_htable_gc_lock);
+	}
 }
 
 #define reg_db_set_attr(attr, pos) do { \




More information about the sr-dev mailing list