Commit 3ad39b9f authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

conncheck: match remote candidates on the socket reliability

When the couple (address, port) is identical between two remote
candidates, we may have to match a remote candidate based on its socket
reliability.
parent f4d5bc1f
......@@ -1923,6 +1923,7 @@ priv_match_remote_candidate_transport_and_socket_type (NiceAgent *agent,
NiceCandidate *candidate, NiceSocket *socket)
{
gboolean ret = TRUE;
gboolean reliable = nice_socket_is_reliable (socket);
g_assert (socket);
g_assert (candidate);
......@@ -1932,15 +1933,14 @@ priv_match_remote_candidate_transport_and_socket_type (NiceAgent *agent,
* couple (address, port), they must be identified by their
* matching transport.
*/
if (socket->type == NICE_SOCKET_TYPE_UDP_BSD &&
candidate->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE)
if (!reliable && candidate->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE)
ret = FALSE;
if (socket->type == NICE_SOCKET_TYPE_TCP_BSD &&
candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP)
if (reliable && candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP)
ret = FALSE;
nice_debug_verbose ("Agent %p : socket/candidate compat: %s and %s: %s",
nice_debug_verbose ("Agent %p : socket/candidate compat: %s (%s) and %s: %s",
agent, priv_socket_type_to_string (socket->type),
reliable ? "reliable" : "not reliable",
priv_candidate_transport_to_string (candidate->transport),
ret ? "yes" : "no");
......
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