[sr-dev] git:4.0: presence: Iterate correctly around presence updates

Hugh Waite hugh.waite at crocodile-rcs.com
Mon Aug 12 12:35:03 CEST 2013


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

Author: Hugh Waite <hugh.waite at crocodile-rcs.com>
Committer: Hugh Waite <hugh.waite at crocodile-rcs.com>
Date:   Mon Aug 12 11:15:55 2013 +0100

presence: Iterate correctly around presence updates

- timer_send_notify should increment the subset by one on each loop

---

 modules/presence/notify.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/presence/notify.c b/modules/presence/notify.c
index d06fa6c..0a7ffb2 100644
--- a/modules/presence/notify.c
+++ b/modules/presence/notify.c
@@ -2667,9 +2667,6 @@ int process_dialogs(int round, int presence_winfo)
 	int updated = 0;
 	db_query_f query_fn = pa_dbf.query_lock ? pa_dbf.query_lock : pa_dbf.query;
 
-	if (++subset > (pres_waitn_time * pres_notifier_poll_rate) -1)
-		subset = 0;
-
 	query_cols[n_query_cols] = &str_updated_col;
 	query_vals[n_query_cols].type = DB1_INT;
 	query_vals[n_query_cols].nul = 0;
@@ -3000,6 +2997,9 @@ void pres_timer_send_notify(unsigned int ticks, void *param)
 	int round = subset + (pres_waitn_time * pres_notifier_poll_rate
 				* process_num);
 
+	if (++subset > (pres_waitn_time * pres_notifier_poll_rate) -1)
+		subset = 0;
+
 	if (process_dialogs(round, 0) < 0)
 	{
 		LM_ERR("Handling non presence.winfo dialogs\n");




More information about the sr-dev mailing list