Wed Aug 6 14:49:13 EDT 2008 Pekka Pessi <first.last@nokia.com>

* 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
This commit is contained in:
Michael Jerris 2008-08-12 17:06:11 +00:00
parent f9865e5593
commit 81e1edffa9
2 changed files with 23 additions and 8 deletions

View File

@ -1 +1 @@
Tue Aug 12 13:04:52 EDT 2008
Tue Aug 12 13:06:05 EDT 2008

View 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;