summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2019-06-22 23:09:45 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2019-07-04 17:03:43 -0400
commit628fc393e36317ea6be417a475cc891e1c12c99c (patch)
treec132c9fe2d471891a7a856cb97ce384f2ecdc805
parentd22547667f95fc4e1b3cfe3c17a2af7f2677c9b0 (diff)
downloadlibnice-628fc393e36317ea6be417a475cc891e1c12c99c.tar.gz
conncheck: create the valid pair on early tcp stun requests
When replaying the incoming checks, we have to create the succeeded valid pair matching this tcp connection the same way we do it in conn_check_handle_inbound_stun().
-rw-r--r--agent/agent.c3
-rw-r--r--agent/conncheck.c20
2 files changed, 23 insertions, 0 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 14d163b..cc1b5c8 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -3864,6 +3864,9 @@ agent_recv_message_unlocked (
new_socket = nice_tcp_passive_socket_accept (nicesock);
if (new_socket) {
_priv_set_socket_tos (agent, new_socket, stream->tos);
+ nice_debug ("Agent %p: add to tcp-pass socket %p a new "
+ "tcp accept socket %p in s/c %d/%d",
+ agent, nicesock, new_socket, stream->id, component->id);
nice_component_attach_socket (component, new_socket);
}
sockret = 0;
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 7a8c73a..5ece935 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -1714,6 +1714,15 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream,
nice_debug ("Agent %p : conn_check_remote_candidates_set %u %u",
agent, stream->id, component->id);
+
+ if (stream->remote_ufrag[0] == 0)
+ return;
+
+
+ if (component->incoming_checks.head)
+ nice_debug ("Agent %p : both remote candidates and credentials set, "
+ "we can process incoming checks", agent);
+
for (k = component->incoming_checks.head; k;) {
IncomingCheck *icheck = k->data;
GList *k_next = k->next;
@@ -1741,6 +1750,14 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream,
}
g_assert (lcand != NULL);
+ if (lcand->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE) {
+ CandidateCheckPair *pair;
+ pair = priv_conn_check_add_for_candidate_pair_matched (agent,
+ stream->id, component, lcand, rcand, NICE_CHECK_SUCCEEDED);
+ if (pair)
+ pair->valid = TRUE;
+ }
+
priv_schedule_triggered_check (agent, stream, component,
icheck->local_socket, rcand);
if (icheck->use_candidate)
@@ -2705,6 +2722,9 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair)
new_socket = nice_tcp_active_socket_connect (pair->sockptr,
&pair->remote->addr);
if (new_socket) {
+ nice_debug ("Agent %p: add to tcp-act socket %p a new "
+ "tcp connect socket %p on pair %p in s/c %d/%d",
+ agent, pair->sockptr, new_socket, pair, stream->id, component->id);
pair->sockptr = new_socket;
_priv_set_socket_tos (agent, pair->sockptr, stream2->tos);