diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-09-20 16:53:26 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2016-05-27 16:45:25 -0400 |
commit | b72b9153d91a93a550c4ec40fce5f9a18e7eaac6 (patch) | |
tree | ffc72dfc25ba8312cbcc1fb121746449c16323fb /agent | |
parent | 059a0e33c973a54c44f7c4fd1e766155f6078f80 (diff) | |
download | libnice-b72b9153d91a93a550c4ec40fce5f9a18e7eaac6.tar.gz |
agent: Restrict transitions to gathering
Only allow transitions to gathering from disconnected or
failed states.
Diffstat (limited to 'agent')
-rw-r--r-- | agent/agent.c | 2 | ||||
-rw-r--r-- | agent/discovery.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/agent/agent.c b/agent/agent.c index fb4a7b1..109a0cd 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -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)); diff --git a/agent/discovery.c b/agent/discovery.c index cf79efb..1265f11 100644 --- a/agent/discovery.c +++ b/agent/discovery.c @@ -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, |