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,
}
}
conn_check_remote_candidates_set(agent);
conn_check_remote_candidates_set(agent, stream, component);
if (added > 0) {
conn_check_schedule_next (agent);
......
......@@ -1106,15 +1106,13 @@ static GSList *prune_cancelled_conn_check (GSList *conncheck_list)
* reaches us. The special case is documented in sect 7.2
* 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) {
NiceStream *stream = i->data;
for (j = stream->conncheck_list; j ; j = j->next) {
CandidateCheckPair *pair = j->data;
NiceComponent *component = nice_stream_find_component_by_id (stream, pair->component_id);
for (j = stream->conncheck_list; j ; j = j->next) {
CandidateCheckPair *pair = j->data;
if (pair->component_id == component->id) {
gboolean match = FALSE;
/* performn delayed processing of spec steps section 7.2.1.4,
......@@ -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);
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);
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);
void
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