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

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.
parent 70fed5e9
...@@ -2369,6 +2369,11 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream * ...@@ -2369,6 +2369,11 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
if (!ok_pair) if (!ok_pair)
ok_pair = p; ok_pair = p;
/* step: updating nominated flag (ICE 7.1.2.2.4 "Updating the
Nominated Flag" (ID-19) */
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*/ /* Do not step down to CONNECTED if we're already at state READY*/
if (component->state != NICE_COMPONENT_STATE_READY) { if (component->state != NICE_COMPONENT_STATE_READY) {
/* step: notify the client of a new component state (must be done /* step: notify the client of a new component state (must be done
...@@ -2376,12 +2381,7 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream * ...@@ -2376,12 +2381,7 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, Stream *
agent_signal_component_state_change (agent, agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_CONNECTED); 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)
priv_update_selected_pair (agent, component, ok_pair);
/* step: update pair states (ICE 7.1.2.2.3 "Updating pair /* step: update pair states (ICE 7.1.2.2.3 "Updating pair
states" and 8.1.2 "Updating States", ID-19) */ states" and 8.1.2 "Updating States", ID-19) */
......
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