diff options
author | Fabrice Bellet <fabrice@bellet.info> | 2020-05-03 17:35:22 +0200 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2020-05-08 18:53:38 +0000 |
commit | 4b704525d1500d78580aa81b73c433737797cc8f (patch) | |
tree | b87ef5156e52ac0251545eeb2078079e90ebc145 /agent/conncheck.c | |
parent | 74f28bda93836822cad5e4a91e602f4d73f5bedb (diff) | |
download | libnice-4b704525d1500d78580aa81b73c433737797cc8f.tar.gz |
conncheck: send udp turn refreshes in oc2007r2 compatibility mode too
Diffstat (limited to 'agent/conncheck.c')
-rw-r--r-- | agent/conncheck.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c index d58478c..15e958b 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -3788,12 +3788,15 @@ priv_calc_turn_timeout (guint lifetime) return lifetime / 2; } -static CandidateRefresh * +static void priv_add_new_turn_refresh (NiceAgent *agent, CandidateDiscovery *cdisco, NiceCandidate *relay_cand, guint lifetime) { CandidateRefresh *cand; + if (cdisco->turn->type != NICE_RELAY_TYPE_TURN_UDP) + return; + cand = g_slice_new0 (CandidateRefresh); agent->refresh_list = g_slist_append (agent->refresh_list, cand); @@ -3810,7 +3813,7 @@ priv_add_new_turn_refresh (NiceAgent *agent, CandidateDiscovery *cdisco, sizeof(cand->stun_resp_buffer)); memcpy(&cand->stun_resp_msg, &cdisco->stun_resp_msg, sizeof(StunMessage)); cand->stun_resp_msg.buffer = cand->stun_resp_buffer; - cand->stun_resp_msg.agent = NULL; + cand->stun_resp_msg.agent = &cand->stun_agent; cand->stun_resp_msg.key = NULL; } @@ -3825,7 +3828,7 @@ priv_add_new_turn_refresh (NiceAgent *agent, CandidateDiscovery *cdisco, nice_debug ("timer source is : %p", cand->timer_source); - return cand; + return; } static void priv_handle_turn_alternate_server (NiceAgent *agent, @@ -3984,9 +3987,8 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage * &d->stun_message); nice_udp_turn_socket_set_ms_connection_id(relay_cand->sockptr, resp); - } else { - priv_add_new_turn_refresh (agent, d, relay_cand, lifetime); } + priv_add_new_turn_refresh (agent, d, relay_cand, lifetime); } relay_cand = discovery_add_relay_candidate ( @@ -4024,9 +4026,8 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage * &d->stun_message); nice_udp_turn_socket_set_ms_connection_id(relay_cand->sockptr, resp); - } else { - priv_add_new_turn_refresh (agent, d, relay_cand, lifetime); } + priv_add_new_turn_refresh (agent, d, relay_cand, lifetime); /* In case a new candidate has been added */ conn_check_schedule_next (agent); |