Changeset 5151
- Timestamp:
- Aug 7, 2015 5:44:40 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r5035 r5151 1150 1150 { 1151 1151 PJ_ASSERT_RETURN(ice_st, PJ_EINVAL); 1152 1153 /* Protect with group lock, since this may cause race condition with 1154 * pj_ice_strans_sendto(). 1155 * See ticket #1877. 1156 */ 1157 pj_grp_lock_acquire(ice_st->grp_lock); 1152 1158 1153 1159 if (ice_st->ice) { … … 1157 1163 1158 1164 ice_st->state = PJ_ICE_STRANS_STATE_INIT; 1165 1166 pj_grp_lock_release(ice_st->grp_lock); 1167 1159 1168 return PJ_SUCCESS; 1160 1169 } … … 1183 1192 if (def_cand >= comp->cand_cnt) 1184 1193 return PJ_EINVALIDOP; 1194 1195 /* Protect with group lock, since this may cause race condition with 1196 * pj_ice_strans_stop_ice(). 1197 * See ticket #1877. 1198 */ 1199 pj_grp_lock_acquire(ice_st->grp_lock); 1185 1200 1186 1201 /* If ICE is available, send data with ICE, otherwise send with the … … 1191 1206 */ 1192 1207 if (ice_st->ice && ice_st->state == PJ_ICE_STRANS_STATE_RUNNING) { 1193 if (comp->turn_sock) {1194 pj_turn_sock_lock(comp->turn_sock);1195 }1196 1208 status = pj_ice_sess_send_data(ice_st->ice, comp_id, data, data_len); 1197 if (comp->turn_sock) {1198 pj_turn_sock_unlock(comp->turn_sock);1199 }1209 1210 pj_grp_lock_release(ice_st->grp_lock); 1211 1200 1212 return status; 1201 1202 } else if (comp->cand_list[def_cand].status == PJ_SUCCESS) { 1213 } 1214 1215 pj_grp_lock_release(ice_st->grp_lock); 1216 1217 if (comp->cand_list[def_cand].status == PJ_SUCCESS) { 1203 1218 1204 1219 if (comp->cand_list[def_cand].type == PJ_ICE_CAND_TYPE_RELAYED) {
Note: See TracChangeset
for help on using the changeset viewer.