[Freeswitch-svn] [commit] r9504 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua

Freeswitch SVN mikej at freeswitch.org
Wed Sep 10 12:20:05 EDT 2008


Author: mikej
Date: Wed Sep 10 12:20:05 2008
New Revision: 9504

Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c

Log:
Wed Sep 10 09:05:24 EDT 2008  Pekka Pessi <first.last at nokia.com>
  * nua_session.c: fixed client request reference counting in nua_session_usage_remove()
  
  Bug reported by Della Betta Filippo.



Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Wed Sep 10 12:20:05 2008
@@ -1 +1 @@
-Wed Sep 10 12:19:39 EDT 2008
+Wed Sep 10 12:19:57 EDT 2008

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c	Wed Sep 10 12:20:05 2008
@@ -258,11 +258,12 @@
     if (cr == cr0)
       continue;
 
+    nua_client_request_ref(cr);
+
     if (nua_invite_client_should_ack(cr)) {
       ss->ss_reporting = 1;
       nua_invite_client_ack(cr, NULL);
       ss->ss_reporting = 0;
-      nua_client_request_clean(cr);
     }
 
     if (cr == du->du_cr && cr->cr_orq)
@@ -278,6 +279,8 @@
 
     nua_client_request_remove(cr);
 
+    nua_client_request_unref(cr);
+
     cr_next = ds->ds_cr;
   }
 

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c	Wed Sep 10 12:20:05 2008
@@ -2154,16 +2154,23 @@
 int
 nua_client_request_remove(nua_client_request_t *cr)
 {
-  if (cr->cr_prev)
+  int retval = 0;
+  int in_queue = cr->cr_prev != NULL;
+
+  if (in_queue) {
     if ((*cr->cr_prev = cr->cr_next))
       cr->cr_next->cr_prev = cr->cr_prev;
+  }
   cr->cr_prev = NULL, cr->cr_next = NULL;
 
   if (cr->cr_timer) {
     su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
-    nua_client_request_unref(cr);
+    retval = nua_client_request_unref(cr);
   }
 
+  if (!in_queue)
+    return retval;
+
   return nua_client_request_unref(cr);
 }
 



More information about the Freeswitch-svn mailing list