Changeset 5971 for pjproject/trunk/pjsip/src/pjsip/sip_transport.c
- Timestamp:
- Apr 23, 2019 8:42:45 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r5909 r5971 1013 1013 PJ_UNUSED_ARG(timer_heap); 1014 1014 1015 if (entry->id == PJ_FALSE) 1016 return; 1017 1015 1018 entry->id = PJ_FALSE; 1016 1019 pjsip_transport_destroy(tp); … … 1049 1052 1050 1053 PJ_ASSERT_RETURN(tp != NULL, PJ_EINVAL); 1054 1055 /* Add ref transport group lock, if any */ 1056 if (tp->grp_lock) 1057 pj_grp_lock_add_ref(tp->grp_lock); 1051 1058 1052 1059 /* Cache some vars for checking transport validity later */ … … 1064 1071 { 1065 1072 if (tp->idle_timer.id != PJ_FALSE) { 1073 tp->idle_timer.id = PJ_FALSE; 1066 1074 pjsip_endpt_cancel_timer(tp->tpmgr->endpt, &tp->idle_timer); 1067 tp->idle_timer.id = PJ_FALSE;1068 1075 } 1069 1076 } … … 1115 1122 } 1116 1123 1117 pj_assert(tp->idle_timer.id == 0); 1118 tp->idle_timer.id = PJ_TRUE; 1119 pjsip_endpt_schedule_timer(tp->tpmgr->endpt, &tp->idle_timer, 1120 &delay); 1124 /* Avoid double timer entry scheduling */ 1125 if (pj_timer_entry_running(&tp->idle_timer)) 1126 pjsip_endpt_cancel_timer(tp->tpmgr->endpt, &tp->idle_timer); 1127 1128 pjsip_endpt_schedule_timer_w_grp_lock(tp->tpmgr->endpt, 1129 &tp->idle_timer, 1130 &delay, 1131 PJ_TRUE, 1132 tp->grp_lock); 1121 1133 } 1122 1134 pj_lock_release(tpmgr->lock); 1123 1135 } 1136 1137 /* Dec ref transport group lock, if any */ 1138 if (tp->grp_lock) 1139 pj_grp_lock_dec_ref(tp->grp_lock); 1124 1140 1125 1141 return PJ_SUCCESS; … … 1169 1185 pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, hval, tp); 1170 1186 1187 /* Add ref transport group lock, if any */ 1188 if (tp->grp_lock) 1189 pj_grp_lock_add_ref(tp->grp_lock); 1190 1171 1191 pj_lock_release(mgr->lock); 1172 1192 … … 1200 1220 //pj_assert(tp->idle_timer.id == PJ_FALSE); 1201 1221 if (tp->idle_timer.id != PJ_FALSE) { 1222 tp->idle_timer.id = PJ_FALSE; 1202 1223 pjsip_endpt_cancel_timer(mgr->endpt, &tp->idle_timer); 1203 tp->idle_timer.id = PJ_FALSE;1204 1224 } 1205 1225 … … 1226 1246 pj_lock_release(mgr->lock); 1227 1247 pj_lock_release(tp->lock); 1248 1249 /* Dec ref transport group lock, if any */ 1250 if (tp->grp_lock) 1251 pj_grp_lock_dec_ref(tp->grp_lock); 1228 1252 1229 1253 /* Destroy. */
Note: See TracChangeset
for help on using the changeset viewer.