agent: Handle failure to create TCP TURN socket

E.g. if the server address is IPv6 but the local system cannot reach it,
so connect() fails right away.
parent c9535025
...@@ -2713,8 +2713,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -2713,8 +2713,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
if (turn->type == NICE_RELAY_TYPE_TURN_UDP) { if (turn->type == NICE_RELAY_TYPE_TURN_UDP) {
if (agent->use_ice_udp == FALSE || turn_tcp == TRUE) { if (agent->use_ice_udp == FALSE || turn_tcp == TRUE) {
g_slice_free (CandidateDiscovery, cdisco); goto skip;
return;
} }
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
NiceAddress addr = nicesock->addr; NiceAddress addr = nicesock->addr;
...@@ -2750,17 +2749,18 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -2750,17 +2749,18 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
/* Ignore tcp candidates if we disabled ice-tcp */ /* Ignore tcp candidates if we disabled ice-tcp */
if ((agent->use_ice_udp == FALSE && reliable_tcp == FALSE) || if ((agent->use_ice_udp == FALSE && reliable_tcp == FALSE) ||
(agent->use_ice_tcp == FALSE && reliable_tcp == TRUE)) { (agent->use_ice_tcp == FALSE && reliable_tcp == TRUE)) {
g_slice_free (CandidateDiscovery, cdisco); goto skip;
return;
} }
if (turn_tcp == FALSE) { if (turn_tcp == FALSE) {
g_slice_free (CandidateDiscovery, cdisco); goto skip;
return;
} }
cdisco->nicesock = agent_create_tcp_turn_socket (agent, stream, cdisco->nicesock = agent_create_tcp_turn_socket (agent, stream,
component, nicesock, &turn->server, turn->type, reliable_tcp); component, nicesock, &turn->server, turn->type, reliable_tcp);
if (!cdisco->nicesock) {
goto skip;
}
nice_component_attach_socket (component, cdisco->nicesock); nice_component_attach_socket (component, cdisco->nicesock);
} }
...@@ -2799,6 +2799,11 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -2799,6 +2799,11 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
agent, cdisco); agent, cdisco);
agent->discovery_list = g_slist_append (agent->discovery_list, cdisco); agent->discovery_list = g_slist_append (agent->discovery_list, cdisco);
++agent->discovery_unsched_items; ++agent->discovery_unsched_items;
return;
skip:
g_slice_free (CandidateDiscovery, cdisco);
} }
NICEAPI_EXPORT guint NICEAPI_EXPORT guint
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment