Commit 922ee4e6 authored by Jakub Adam's avatar Jakub Adam Committed by Olivier Crête

agent: don't require "reliable" be TRUE in order to use "ice-tcp"

Setting writable socket callbacks doesn't have to be limited to reliable
agents. TCP sockets need the callback in any case for correct operation
and calling nice_socket_set_writable_callback() on a NiceSocket that has
UDP as its base has no effect.

Differential Revision: https://phabricator.freedesktop.org/D1726
parent 54fb0342
......@@ -2547,9 +2547,8 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
if (nicesock == NULL)
return;
if (agent->reliable)
nice_socket_set_writable_callback (nicesock, _tcp_sock_is_writable,
component);
nice_socket_set_writable_callback (nicesock, _tcp_sock_is_writable, component);
if (turn->type == NICE_RELAY_TYPE_TURN_TLS &&
agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
nicesock = nice_pseudossl_socket_new (nicesock,
......@@ -3033,10 +3032,8 @@ nice_agent_gather_candidates (
found_local_address = TRUE;
nice_address_set_port (addr, 0);
if (agent->reliable)
nice_socket_set_writable_callback (host_candidate->sockptr,
_tcp_sock_is_writable, component);
nice_socket_set_writable_callback (host_candidate->sockptr,
_tcp_sock_is_writable, component);
#ifdef HAVE_GUPNP
if (agent->upnp_enabled && agent->upnp &&
......
......@@ -2669,9 +2669,8 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
pair->sockptr = new_socket;
_priv_set_socket_tos (agent, pair->sockptr, stream2->tos);
if (agent->reliable)
nice_socket_set_writable_callback (pair->sockptr,
_tcp_sock_is_writable, component2);
nice_socket_set_writable_callback (pair->sockptr, _tcp_sock_is_writable,
component2);
nice_component_attach_socket (component2, new_socket);
}
......
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