Commit b72b9153 authored by Olivier Crête's avatar Olivier Crête

agent: Restrict transitions to gathering

Only allow transitions to gathering from disconnected or
failed states.
parent 059a0e33
......@@ -2149,6 +2149,8 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
/* If set_remote_candidates() is called with new candidates after
* reaching FAILED: */
TRANSITION (FAILED, CONNECTING) ||
/* if new relay servers are added to a failed connection */
TRANSITION (FAILED, GATHERING) ||
/* Possible by calling set_remote_candidates() without calling
* nice_agent_gather_candidates(): */
TRANSITION (DISCONNECTED, CONNECTING));
......
......@@ -1022,10 +1022,12 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
(cand->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
cand->type == NICE_CANDIDATE_TYPE_RELAYED)) {
agent_signal_component_state_change (agent,
cand->stream->id,
cand->component->id,
NICE_COMPONENT_STATE_GATHERING);
if (cand->component->state == NICE_COMPONENT_STATE_DISCONNECTED ||
cand->component->state == NICE_COMPONENT_STATE_FAILED)
agent_signal_component_state_change (agent,
cand->stream->id,
cand->component->id,
NICE_COMPONENT_STATE_GATHERING);
if (cand->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE) {
buffer_len = stun_usage_bind_create (&cand->stun_agent,
......
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