Changeset 5474
- Timestamp:
- Oct 28, 2016 3:57:55 AM (8 years ago)
- Location:
- pjproject/trunk/pjnath/src/pjnath
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r5465 r5474 165 165 } turn[PJ_ICE_MAX_TURN]; 166 166 167 pj_bool_t creating; /**< Is creating the candidates?*/ 167 168 unsigned cand_cnt; /**< # of candidates/aliaes. */ 168 169 pj_ice_sess_cand cand_list[PJ_ICE_ST_MAX_CAND]; /**< Cand array */ … … 666 667 comp->ice_st = ice_st; 667 668 comp->comp_id = comp_id; 669 comp->creating = PJ_TRUE; 668 670 669 671 ice_st->comp[comp_id-1] = comp; … … 693 695 } 694 696 } 697 698 /* Done creating all the candidates */ 699 comp->creating = PJ_FALSE; 695 700 696 701 /* It's possible that we end up without any candidates */ … … 933 938 pj_ice_strans_comp *comp = ice_st->comp[i]; 934 939 940 /* This function can be called when all components or candidates 941 * have not been created. 942 */ 943 if (!comp || comp->creating) return; 944 935 945 for (j=0; j<comp->cand_cnt; ++j) { 936 946 pj_ice_sess_cand *cand = &comp->cand_list[j]; … … 1308 1318 } 1309 1319 1310 if (count ) {1320 if (count && !comp->turn[n].err_cnt && comp->turn[n].sock) { 1311 1321 status = pj_turn_sock_set_perm(comp->turn[n].sock, count, 1312 1322 addrs, 0); … … 1990 2000 sess_init_update(comp->ice_st); 1991 2001 1992 } else if (old_state == PJ_TURN_STATE_RESOLVING && 2002 } else if ((old_state == PJ_TURN_STATE_RESOLVING || 2003 old_state == PJ_TURN_STATE_RESOLVED) && 1993 2004 new_state == PJ_TURN_STATE_DESTROYING) 1994 2005 { … … 1996 2007 unsigned i; 1997 2008 1998 /* DNS resolution has failed! */ 2009 /* DNS resolution or TURN transport creation/allocation 2010 * has failed. 2011 */ 1999 2012 ++comp->turn[tp_idx].err_cnt; 2000 2013 … … 2015 2028 } 2016 2029 } 2017 pj_assert(cand != NULL);2018 2030 2019 2031 pj_grp_lock_release(comp->ice_st->grp_lock); 2020 2032 2021 cand->status = PJ_ERESOLVE; 2033 /* If the error happens during pj_turn_sock_create() or 2034 * pj_turn_sock_alloc(), the candidate hasn't been added 2035 * to the list. 2036 */ 2037 if (cand) cand->status = PJ_ERESOLVE; 2022 2038 2023 2039 sess_init_update(comp->ice_st); -
pjproject/trunk/pjnath/src/pjnath/turn_sock.c
r5380 r5474 891 891 on_connect_complete(turn_sock->active_sock, PJ_SUCCESS); 892 892 } else if (status != PJ_EPENDING) { 893 pj_perror(3, turn_sock->pool->obj_name, status, 894 "Failed to connect to %s", 895 pj_sockaddr_print(&info.server, addrtxt, 896 sizeof(addrtxt), 3)); 893 897 pj_turn_sock_destroy(turn_sock); 894 898 return;
Note: See TracChangeset
for help on using the changeset viewer.