Module: sip-router
Branch: master
Commit: d1cda7ca9a64cf818b82f7b777fa2dd640717c53
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d1cda7c…
Author: Hugh Waite <hugh.waite(a)crocodile-rcs.com>
Committer: Hugh Waite <hugh.waite(a)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");