提交 d9629325 authored 作者: Michael Jerris's avatar Michael Jerris

Mon Jul 21 13:06:54 EDT 2008 Pekka.Pessi@nokia.com

  * outbound.c: destroy response to OPTIONS keepalive only when it is no more used



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9261 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 31180ed1
Tue Jul 8 00:36:02 EDT 2008 Tue Aug 12 13:00:08 EDT 2008
...@@ -647,6 +647,11 @@ static int keepalive_options_with_registration_probe(outbound_t *ob); ...@@ -647,6 +647,11 @@ static int keepalive_options_with_registration_probe(outbound_t *ob);
static int response_to_keepalive_options(outbound_t *ob, static int response_to_keepalive_options(outbound_t *ob,
nta_outgoing_t *orq, nta_outgoing_t *orq,
sip_t const *sip); sip_t const *sip);
static int process_response_to_keepalive_options(outbound_t *ob,
nta_outgoing_t *orq,
sip_t const *sip,
int status,
char const *phrase);
static void keepalive_timer(su_root_magic_t *root_magic, static void keepalive_timer(su_root_magic_t *root_magic,
su_timer_t *t, su_timer_t *t,
...@@ -828,10 +833,6 @@ static int response_to_keepalive_options(outbound_t *ob, ...@@ -828,10 +833,6 @@ static int response_to_keepalive_options(outbound_t *ob,
{ {
int status = 408; int status = 408;
char const *phrase = sip_408_Request_timeout; char const *phrase = sip_408_Request_timeout;
int binding_check;
int challenged = 0, credentials = 0;
msg_t *_reqmsg = nta_outgoing_getrequest(orq);
sip_t *request = sip_object(_reqmsg); msg_destroy(_reqmsg);
if (sip && sip->sip_status) { if (sip && sip->sip_status) {
status = sip->sip_status->st_status; status = sip->sip_status->st_status;
...@@ -842,8 +843,26 @@ static int response_to_keepalive_options(outbound_t *ob, ...@@ -842,8 +843,26 @@ static int response_to_keepalive_options(outbound_t *ob,
/* This probably means that we are in trouble. whattodo, whattodo */ /* This probably means that we are in trouble. whattodo, whattodo */
} }
if (status < 200) if (status >= 200) {
return 0; if (orq == ob->ob_keepalive.orq)
ob->ob_keepalive.orq = NULL;
process_response_to_keepalive_options(ob, orq, sip, status, phrase);
nta_outgoing_destroy(orq);
}
return 0;
}
static int process_response_to_keepalive_options(outbound_t *ob,
nta_outgoing_t *orq,
sip_t const *sip,
int status,
char const *phrase)
{
int binding_check;
int challenged = 0, credentials = 0;
msg_t *_reqmsg = nta_outgoing_getrequest(orq);
sip_t *request = sip_object(_reqmsg); msg_destroy(_reqmsg);
if (sip == NULL) { if (sip == NULL) {
SU_DEBUG_3(("outbound(%p): keepalive %u %s\n", (void *)ob->ob_owner, SU_DEBUG_3(("outbound(%p): keepalive %u %s\n", (void *)ob->ob_owner,
...@@ -870,10 +889,6 @@ static int response_to_keepalive_options(outbound_t *ob, ...@@ -870,10 +889,6 @@ static int response_to_keepalive_options(outbound_t *ob,
binding_check = outbound_nat_detect(ob, request, sip); binding_check = outbound_nat_detect(ob, request, sip);
if (orq == ob->ob_keepalive.orq)
ob->ob_keepalive.orq = NULL;
nta_outgoing_destroy(orq);
if (binding_check > 1) { if (binding_check > 1) {
/* Bindings have changed */ /* Bindings have changed */
if (outbound_contacts_from_via(ob, sip->sip_via) == 0) { if (outbound_contacts_from_via(ob, sip->sip_via) == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论