summaryrefslogtreecommitdiff
path: root/res/pjproject
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2012-07-06 14:32:30 +0000
committerJoshua Colp <jcolp@digium.com>2012-07-06 14:32:30 +0000
commit96a4b257bd10ab5aaa6f25a0716a0f521a2bf5a0 (patch)
treeab7c93436cf115c474cbdefd34bda53e3c623a5e /res/pjproject
parent3044aa3e38042aab43a96f31bdce54cf5f200e4c (diff)
Import revision 4196 from pjproject trunk. Fix a crash issue when starting ICE connectivity checks and immediately destroying the ICE session. This was exposed by the SIP CCSS test.
Full fix for this issue will be worked on as a medium to long term roadmap item. pjroject issue viewable at https://trac.pjsip.org/repos/ticket/1548 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/pjproject')
-rw-r--r--res/pjproject/pjnath/include/pjnath/ice_session.h1
-rw-r--r--res/pjproject/pjnath/src/pjnath/ice_session.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/res/pjproject/pjnath/include/pjnath/ice_session.h b/res/pjproject/pjnath/include/pjnath/ice_session.h
index cf153728a..f48e12d41 100644
--- a/res/pjproject/pjnath/include/pjnath/ice_session.h
+++ b/res/pjproject/pjnath/include/pjnath/ice_session.h
@@ -619,6 +619,7 @@ struct pj_ice_sess
pj_uint8_t *prefs; /**< Type preference. */
pj_bool_t is_nominating; /**< Nominating stage */
pj_bool_t is_complete; /**< Complete? */
+ pj_bool_t is_destroying; /**< Destroy is called */
pj_status_t ice_status; /**< Error status. */
pj_timer_entry timer; /**< ICE timer. */
pj_ice_sess_cb cb; /**< Callback. */
diff --git a/res/pjproject/pjnath/src/pjnath/ice_session.c b/res/pjproject/pjnath/src/pjnath/ice_session.c
index bf94e5451..40e10d558 100644
--- a/res/pjproject/pjnath/src/pjnath/ice_session.c
+++ b/res/pjproject/pjnath/src/pjnath/ice_session.c
@@ -455,6 +455,8 @@ static void destroy_ice(pj_ice_sess *ice,
LOG4((ice->obj_name, "Destroying ICE session"));
}
+ ice->is_destroying = PJ_TRUE;
+
/* Let other callbacks finish */
if (ice->mutex) {
pj_mutex_lock(ice->mutex);
@@ -1840,8 +1842,16 @@ static pj_status_t start_periodic_check(pj_timer_heap_t *th,
ice = td->ice;
clist = td->clist;
+ if (ice->is_destroying)
+ return PJ_SUCCESS;
+
pj_mutex_lock(ice->mutex);
+ if (ice->is_destroying) {
+ pj_mutex_unlock(ice->mutex);
+ return PJ_SUCCESS;
+ }
+
/* Set timer ID to FALSE first */
te->id = PJ_FALSE;