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

Author: Peter Dunkley <[email protected]>
Committer: Peter Dunkley <[email protected]>
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

---

 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)
                {


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to