[sr-dev] git:master: modules_k/pua: Fixed incorrect check/ use of update_period modparam

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Sep 11 14:24:00 CEST 2012


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Sep 11 12:58:13 2012 +0100

modules_k/pua: Fixed incorrect check/use of update_period modparam

---

 modules_k/pua/pua.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules_k/pua/pua.c b/modules_k/pua/pua.c
index b72f9e1..2297219 100644
--- a/modules_k/pua/pua.c
+++ b/modules_k/pua/pua.c
@@ -268,8 +268,13 @@ static int mod_init(void)
 
 	startup_time = (int) time(NULL);
 
-	if (update_period > 0) /* probably should check > 5 here!! -croc */
+	if (update_period > 5)
 		register_timer(hashT_clean, 0, update_period- 5);
+	else if (update_period != 0)
+	{
+		LM_ERR("update_period must be 0 or > 5\n");
+		return -1;
+	}
 
 	if (dbmode != PUA_DB_ONLY) 
 	{        




More information about the sr-dev mailing list