Commit 47a96334 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

component: reset the stun agent on ice restart

The stun agent may contain references to the password previously stored
in some remote candidates, freeed by nice_component_restart(), that were
used by keep-alive stun requests. These stun replies may arrive later
after ice has been restarted. Since the remote candidates are freeed
when ice is restarted, the stun agent must be reset to get rid of these
related references.
parent b0a9fccf
......@@ -433,7 +433,7 @@ nice_component_find_pair (NiceComponent *cmp, NiceAgent *agent, const gchar *lfo
* session.
*/
void
nice_component_restart (NiceComponent *cmp)
nice_component_restart (NiceComponent *cmp, NiceAgent *agent)
{
GSList *i;
IncomingCheck *c;
......@@ -463,6 +463,13 @@ nice_component_restart (NiceComponent *cmp)
cmp->have_local_consent = TRUE;
/* The stun agent may contain references to the password previously
* stored in some remote candidates, freeed here, that were used by
* keep-alive stun requests. The stun agent must be reset to get rid
* of these references.
*/
nice_agent_init_stun_agent (agent, &cmp->stun_agent);
/* note: component state managed by agent */
}
......
......@@ -261,7 +261,7 @@ nice_component_find_pair (NiceComponent *component, NiceAgent *agent,
const gchar *lfoundation, const gchar *rfoundation, CandidatePair *pair);
void
nice_component_restart (NiceComponent *component);
nice_component_restart (NiceComponent *component, NiceAgent *agent);
void
nice_component_update_selected_pair (NiceAgent *agent, NiceComponent *component,
......
......@@ -145,7 +145,7 @@ nice_stream_restart (NiceStream *stream, NiceAgent *agent)
for (i = stream->components; i; i = i->next) {
NiceComponent *component = i->data;
nice_component_restart (component);
nice_component_restart (component, agent);
agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_GATHERING);
}
......
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