提交 59478dd5 authored 作者: Michael Jerris's avatar Michael Jerris

Thu Apr 16 12:04:08 CDT 2009 Pekka Pessi <first.last@nokia.com>

  * nua_client, nua_session: avoid restarting in-progress transactions
  
  This is supposed to fix bugs #SFSIP-135 and #SFSIP-137. Thanks for Tamas
  Jalsovszky and kawarod for reporting the problem.



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13062 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 5278050e
Thu Apr 16 10:00:29 CDT 2009 Thu Apr 16 12:18:30 CDT 2009
...@@ -413,6 +413,20 @@ int nua_client_bind(nua_client_request_t *cr, nua_dialog_usage_t *du) ...@@ -413,6 +413,20 @@ int nua_client_bind(nua_client_request_t *cr, nua_dialog_usage_t *du)
return 0; return 0;
} }
/** Check if client request is in progress.
*
* A client request is in progress, if
* 1) it has actual transaction going on
* 2) it is waiting credentials from application
* 3) it is waiting for Retry-After timer
*/
int
nua_client_request_in_progress(nua_client_request_t const *cr)
{
return cr &&
(cr->cr_orq || cr->cr_wait_for_cred || cr->cr_timer);
}
/**Initialize client request for sending. /**Initialize client request for sending.
* *
* This function is called when the request is taken from queue and sent. * This function is called when the request is taken from queue and sent.
...@@ -1564,7 +1578,7 @@ int nua_client_next_request(nua_client_request_t *cr, int invite) ...@@ -1564,7 +1578,7 @@ int nua_client_next_request(nua_client_request_t *cr, int invite)
break; break;
} }
if (cr && cr->cr_orq == NULL) { if (cr && !nua_client_request_in_progress(cr)) {
nua_client_init_request(cr); nua_client_init_request(cr);
} }
......
...@@ -250,6 +250,8 @@ su_inline int nua_client_is_queued(nua_client_request_t const *cr) ...@@ -250,6 +250,8 @@ su_inline int nua_client_is_queued(nua_client_request_t const *cr)
return cr && cr->cr_prev; return cr && cr->cr_prev;
} }
int nua_client_request_in_progress(nua_client_request_t const *cr);
int nua_client_request_complete(nua_client_request_t *cr); int nua_client_request_complete(nua_client_request_t *cr);
int nua_client_request_remove(nua_client_request_t *cr); int nua_client_request_remove(nua_client_request_t *cr);
int nua_client_request_clean(nua_client_request_t *cr); int nua_client_request_clean(nua_client_request_t *cr);
......
...@@ -1535,7 +1535,7 @@ static void nua_session_usage_refresh(nua_handle_t *nh, ...@@ -1535,7 +1535,7 @@ static void nua_session_usage_refresh(nua_handle_t *nh,
if (ss->ss_state >= nua_callstate_terminating || if (ss->ss_state >= nua_callstate_terminating ||
/* INVITE is in progress or being authenticated */ /* INVITE is in progress or being authenticated */
(cr && (cr->cr_orq || cr->cr_wait_for_cred))) nua_client_request_in_progress(cr))
return; return;
/* UPDATE has been queued */ /* UPDATE has been queued */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论