summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@ktknet.cz>2017-04-19 14:17:04 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-03-23 17:32:37 -0400
commit922ee4e61b4d9c6b403933f4a3261e67589d5099 (patch)
treed6aaed5d322f64bd7313c1432ba21b71281faa63
parent54fb03427ebc13413cd1ddd5d9e91c1751eac0cb (diff)
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
-rw-r--r--agent/agent.c11
-rw-r--r--agent/conncheck.c5
2 files changed, 6 insertions, 10 deletions
diff --git a/agent/agent.c b/agent/agent.c
index dbece3b..89e3514 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -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 &&
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 19729c2..64a3cb8 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -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);
}