conncheck: Go to connected only if the component was connected or ready
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 12 Aug 2014 22:40:47 +0000 (18:40 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Tue, 12 Aug 2014 22:40:47 +0000 (18:40 -0400)
Otherwise, it claimed it was connected when the component was in the FAILED
state, when it should really have gone to connecting.

agent/conncheck.c

index 00a533a..ad17ede 100644 (file)
@@ -1360,16 +1360,17 @@ static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent,
       local->foundation, remote->foundation);
   priv_add_new_check_pair (agent, stream_id, component, local, remote,
       initial_state, FALSE);
-  if (component->state < NICE_COMPONENT_STATE_CONNECTED) {
+  if (component->state == NICE_COMPONENT_STATE_CONNECTED ||
+      component->state == NICE_COMPONENT_STATE_READY) {
     agent_signal_component_state_change (agent,
         stream_id,
         component->id,
-        NICE_COMPONENT_STATE_CONNECTING);
+        NICE_COMPONENT_STATE_CONNECTED);
   } else {
     agent_signal_component_state_change (agent,
         stream_id,
         component->id,
-        NICE_COMPONENT_STATE_CONNECTED);
+        NICE_COMPONENT_STATE_CONNECTING);
   }
 }