[sr-dev] git:3.3: modules_k/presence: partial NOTIFYs for presence. winfo not correctly formed when using notifier processes

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu Jun 14 18:45:50 CEST 2012


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Thu Jun 14 17:43:54 2012 +0100

modules_k/presence: partial NOTIFYs for presence.winfo not correctly formed when using notifier processes

- I seem to have broken things when I did a pre-merge re-order/clean-up
  of the code
- Issue found by Hugh Waite @ Crocodile RCS and fixed by Hugh Waite and
  Peter Dunkley @ Crocodile RCS
(cherry picked from commit 5ed96d257f2d402597a678e4451fd9011786f4a2)

---

 modules_k/presence/notify.c |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/modules_k/presence/notify.c b/modules_k/presence/notify.c
index 91bdc46..73675e1 100644
--- a/modules_k/presence/notify.c
+++ b/modules_k/presence/notify.c
@@ -2513,25 +2513,6 @@ static int notifier_notify(subs_t *sub, int *updated, int *end_transaction)
 	{
 		if (sub->event->type & WINFO_TYPE) /* presence.winfo dialog */
 		{
-			if (unset_watchers_updated_winfo(&sub->pres_uri) < 0)
-			{
-				LM_WARN("resetting updated_winfo flags\n");
-
-				if (pa_dbf.abort_transaction)
-				{
-					if (pa_dbf.abort_transaction(pa_db) < 0)
-					{
-						LM_ERR("in abort_transaction\n");
-						goto error;
-					}
-				}
-				*end_transaction = 0;
-
-				/* Make sure this gets tried again next time */
-				*updated = 1;
-				goto done;
-			}
-
 			if (sub->updated_winfo == NO_UPDATE_TYPE)
 			{
 				/* Partial notify if
@@ -2565,6 +2546,26 @@ static int notifier_notify(subs_t *sub, int *updated, int *end_transaction)
 			}
 			else	/* Full presence.winfo NOTIFY */
 				sub->updated_winfo = NO_UPDATE_TYPE;
+
+			if (unset_watchers_updated_winfo(&sub->pres_uri) < 0)
+			{
+				LM_WARN("resetting updated_winfo flags\n");
+
+				if (pa_dbf.abort_transaction)
+				{
+					if (pa_dbf.abort_transaction(pa_db) < 0)
+					{
+						LM_ERR("in abort_transaction\n");
+						goto error;
+					}
+				}
+				*end_transaction = 0;
+
+				/* Make sure this gets tried again next time */
+				*updated = 1;
+				goto done;
+			}
+
 		}
 		else if (sub->event->type & PUBL_TYPE)
 		{




More information about the sr-dev mailing list