]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Wed Aug 6 14:49:13 EDT 2008 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Tue, 12 Aug 2008 17:06:11 +0000 (17:06 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 12 Aug 2008 17:06:11 +0000 (17:06 +0000)
  * nta: fix to #2037585: always release error callback when changing transports

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9274 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nta/nta.c

index 7612a61d313ddb00dc5c8e1e92d25826c4a757ca..50310070baa4752e7bd646679eb4acd82572d96d 100644 (file)
@@ -1 +1 @@
-Tue Aug 12 13:04:52 EDT 2008
+Tue Aug 12 13:06:05 EDT 2008
index 98197ece65691349d4bd086091f3b0d15c202453..577e88f173f976ccc7ad6747987e2a9f7108c2f4 100644 (file)
@@ -7343,6 +7343,12 @@ outgoing_send_via(nta_outgoing_t *orq, tport_t *tp)
 
   orq->orq_tport = tport_ref(tp);
 
+  if (orq->orq_pending && tp != old_tp) {
+    tport_release(old_tp, orq->orq_pending,
+                 orq->orq_request, NULL, orq, 0);
+    orq->orq_pending = 0;
+  }
+
   if (old_tp) tport_unref(old_tp);
 
   if (outgoing_insert_via(orq, agent_tport_via(tp)) < 0) {
@@ -7441,6 +7447,12 @@ outgoing_send(nta_outgoing_t *orq, int retransmit)
     if (orq->orq_try_udp_instead)
       tag = tptag_mtu, value = 65535;
 
+    if (orq->orq_pending) {
+      tport_release(orq->orq_tport, orq->orq_pending,
+                   orq->orq_request, NULL, orq, 0);
+      orq->orq_pending = 0;
+    }
+
     tp = tport_tsend(orq->orq_tport, msg, tpn, 
                     tag, value,
                     IF_SIGCOMP_TPTAG_COMPARTMENT(cc)
@@ -7477,12 +7489,6 @@ outgoing_send(nta_outgoing_t *orq, int retransmit)
       }
     }
 
-    if (orq->orq_pending && orq->orq_tport)
-      tport_release(orq->orq_tport, orq->orq_pending, orq->orq_request, 
-                   NULL, orq, 0);
-
-    orq->orq_pending = 0;
-
     outgoing_tport_error(agent, orq, NULL, orq->orq_request, err);
 
     return;
@@ -7548,6 +7554,8 @@ outgoing_try_tcp_instead(nta_outgoing_t *orq)
   tport_t *tp;
   tp_name_t tpn[1];
 
+  assert(orq->orq_pending == 0);
+
   *tpn = *orq->orq_tpn;
   tpn->tpn_proto = "tcp";
   orq->orq_try_tcp_instead = 1;
@@ -7568,8 +7576,9 @@ outgoing_try_tcp_instead(nta_outgoing_t *orq)
     return;
   }
 
+  /* No TCP - try again with UDP without SIP MTU limit */
   tpn->tpn_proto = "udp";
-  orq->orq_try_udp_instead = 1;        /* Try again without SIP MTU limit */
+  orq->orq_try_udp_instead = 1;
 
   tp = tport_by_name(orq->orq_agent->sa_tports, tpn);
   if (tp && tp != orq->orq_tport) {
@@ -7587,6 +7596,12 @@ outgoing_try_udp_instead(nta_outgoing_t *orq)
   tport_t *tp;
   tp_name_t tpn[1];
 
+  if (orq->orq_pending) {
+    tport_release(orq->orq_tport, orq->orq_pending,
+                 orq->orq_request, NULL, orq, 0);
+    orq->orq_pending = 0;
+  }
+
   *tpn = *orq->orq_tpn;
   tpn->tpn_proto = "udp";
   orq->orq_try_udp_instead = 1;