summaryrefslogtreecommitdiffstats
path: root/libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch')
-rw-r--r--libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch b/libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch
new file mode 100644
index 0000000000..5d7b44b9f5
--- /dev/null
+++ b/libraries/pjproject-ring/patches/pj_uwp_fix_turn_fallback.patch
@@ -0,0 +1,51 @@
+--- a/pjnath/src/pjnath/turn_session.c
++++ b/pjnath/src/pjnath/turn_session.c
+@@ -653,3 +653,3 @@
+
+- cnt = PJ_TURN_MAX_DNS_SRV_CNT;
++ cnt = 1;
+ ai = (pj_addrinfo*)
+--- a/pjnath/src/pjnath/ice_strans.c
++++ b/pjnath/src/pjnath/ice_strans.c
+@@ -2078,6 +2078,38 @@ static void turn_on_state(pj_turn_sock *turn_sock, pj_turn_state_t old_state,
+ }
+
+ sess_init_update(comp->ice_st);
++ } else if ((old_state == PJ_TURN_STATE_RESOLVING || old_state == PJ_TURN_STATE_ALLOCATING) &&
++ new_state >= PJ_TURN_STATE_DEALLOCATING)
++ {
++ pj_ice_sess_cand *cand = NULL;
++ unsigned i;
++
++ /* DNS resolution has failed! */
++ ++comp->turn[tp_idx].err_cnt;
++
++ /* Unregister ourself from the TURN relay */
++ pj_turn_sock_set_user_data(turn_sock, NULL);
++ comp->turn[tp_idx].sock = NULL;
++
++ /* Wait until initialization completes */
++ pj_grp_lock_acquire(comp->ice_st->grp_lock);
++
++ /* Find relayed candidate in the component */
++ for (i=0; i<comp->cand_cnt; ++i) {
++ if (comp->cand_list[i].type == PJ_ICE_CAND_TYPE_RELAYED &&
++ comp->cand_list[i].transport_id == data->transport_id)
++ {
++ cand = &comp->cand_list[i];
++ break;
++ }
++ }
++ pj_assert(cand != NULL);
++
++ pj_grp_lock_release(comp->ice_st->grp_lock);
++
++ cand->status = old_state == PJ_TURN_STATE_RESOLVING ? PJ_ERESOLVE : PJ_EINVALIDOP;
++
++ sess_init_update(comp->ice_st);
+
+ } else if (new_state >= PJ_TURN_STATE_DEALLOCATING) {
+ pj_turn_session_info info;
+--
+2.8.1.windows.1
+