Commit 71e27109 authored by Olivier Crête's avatar Olivier Crête

conncheck: fix the replay of early incoming connchecks

This patch fixes a bug in the way the list of incoming checks
is handled. The code purges this list too early, before all ichecks
for a given component are processed. It happens because the component
is computed from each pair of the check list, instead of being passed
as a fixed parameter of the function.

Differential Revision: https://phabricator.freedesktop.org/D882
parent acdc0b8b
...@@ -3291,7 +3291,7 @@ _set_remote_candidates_locked (NiceAgent *agent, NiceStream *stream, ...@@ -3291,7 +3291,7 @@ _set_remote_candidates_locked (NiceAgent *agent, NiceStream *stream,
} }
} }
conn_check_remote_candidates_set(agent); conn_check_remote_candidates_set(agent, stream, component);
if (added > 0) { if (added > 0) {
conn_check_schedule_next (agent); conn_check_schedule_next (agent);
......
...@@ -1106,15 +1106,13 @@ static GSList *prune_cancelled_conn_check (GSList *conncheck_list) ...@@ -1106,15 +1106,13 @@ static GSList *prune_cancelled_conn_check (GSList *conncheck_list)
* reaches us. The special case is documented in sect 7.2 * reaches us. The special case is documented in sect 7.2
* if ICE spec (ID-19). * if ICE spec (ID-19).
*/ */
void conn_check_remote_candidates_set(NiceAgent *agent) void conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream, NiceComponent *component)
{ {
GSList *i, *j, *k, *l, *m, *n; GSList *j, *k, *l, *m, *n;
for (i = agent->streams; i ; i = i->next) { for (j = stream->conncheck_list; j ; j = j->next) {
NiceStream *stream = i->data; CandidateCheckPair *pair = j->data;
for (j = stream->conncheck_list; j ; j = j->next) { if (pair->component_id == component->id) {
CandidateCheckPair *pair = j->data;
NiceComponent *component = nice_stream_find_component_by_id (stream, pair->component_id);
gboolean match = FALSE; gboolean match = FALSE;
/* performn delayed processing of spec steps section 7.2.1.4, /* performn delayed processing of spec steps section 7.2.1.4,
...@@ -1221,18 +1219,18 @@ void conn_check_remote_candidates_set(NiceAgent *agent) ...@@ -1221,18 +1219,18 @@ void conn_check_remote_candidates_set(NiceAgent *agent)
} }
} }
} }
/* Once we process the pending checks, we should free them to avoid
* reprocessing them again if a dribble-mode set_remote_candidates
* is called */
g_slist_free_full (component->incoming_checks,
(GDestroyNotify) incoming_check_free);
component->incoming_checks = NULL;
} }
stream->conncheck_list =
prune_cancelled_conn_check (stream->conncheck_list);
} }
/* Once we process the pending checks, we should free them to avoid
* reprocessing them again if a dribble-mode set_remote_candidates
* is called */
g_slist_free_full (component->incoming_checks,
(GDestroyNotify) incoming_check_free);
component->incoming_checks = NULL;
stream->conncheck_list =
prune_cancelled_conn_check (stream->conncheck_list);
} }
/* /*
......
...@@ -105,7 +105,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair); ...@@ -105,7 +105,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream); void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len); gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b); gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b);
void conn_check_remote_candidates_set(NiceAgent *agent); void conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream, NiceComponent *component);
NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport); NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport);
void void
conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *component, conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *component,
......
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