diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2014-07-31 15:16:38 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2014-10-09 15:28:21 -0400 |
commit | fcb1b84fd81f7db7dfe25bad824cb7fcfb254469 (patch) | |
tree | a80593983db7ed6a67ff26d610295aa3a18891a2 | |
parent | 70fed5e9eb4f0046f85db81f2981dca589ac84fe (diff) |
agent: Declare the stream to be CONNECTED only if a pair is selected
Don't change the state if no pair is selected. Otherwise we get
a component that claims to be CONNECTED but has no selected pair.
Also, set the selected pair before announcing the state change.
-rw-r--r-- | agent/conncheck.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c index 3722947..0fcfb16 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -2369,20 +2369,20 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream * if (!ok_pair) ok_pair = p; - /* Do not step down to CONNECTED if we're already at state READY*/ - if (component->state != NICE_COMPONENT_STATE_READY) { - /* step: notify the client of a new component state (must be done - * before the possible check list state update step */ - agent_signal_component_state_change (agent, - stream->id, component->id, NICE_COMPONENT_STATE_CONNECTED); - } - - /* step: updating nominated flag (ICE 7.1.2.2.4 "Updating the Nominated Flag" (ID-19) */ - if (ok_pair->nominated == TRUE) + if (ok_pair->nominated == TRUE) { priv_update_selected_pair (agent, component, ok_pair); + /* Do not step down to CONNECTED if we're already at state READY*/ + if (component->state != NICE_COMPONENT_STATE_READY) { + /* step: notify the client of a new component state (must be done + * before the possible check list state update step */ + agent_signal_component_state_change (agent, + stream->id, component->id, NICE_COMPONENT_STATE_CONNECTED); + } + } + /* step: update pair states (ICE 7.1.2.2.3 "Updating pair states" and 8.1.2 "Updating States", ID-19) */ priv_update_check_list_state_for_ready (agent, stream, component); |