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

Add prints

parent d445746b
......@@ -153,6 +153,7 @@ void agent_lock (void)
void agent_unlock (void)
{
nice_debug("agent_unlock");
g_mutex_unlock (&agent_mutex);
}
......@@ -192,11 +193,13 @@ agent_unlock_and_emit (NiceAgent *agent)
GQueue queue = G_QUEUE_INIT;
QueuedSignal *sig;
nice_debug("agent_unlock_and_emit");
queue = agent->pending_signals;
g_queue_init (&agent->pending_signals);
agent_unlock ();
g_mutex_unlock (&agent_mutex);
while ((sig = g_queue_pop_head (&queue))) {
g_signal_emitv (sig->params, sig->signal_id, 0, NULL);
......@@ -4437,7 +4440,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data)
}
nice_component_remove_socket (component, socket_source->socket);
agent_unlock ();
agent_unlock_and_emit (agent);
g_object_unref (agent);
return G_SOURCE_REMOVE;
}
......@@ -5638,7 +5641,7 @@ nice_agent_get_component_state (NiceAgent *agent,
if (agent_find_component (agent, stream_id, component_id, NULL, &component))
state = component->state;
agent_unlock ();
agent_unlock_and_emit (agent);
return state;
}
......@@ -1999,9 +1999,11 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream
component->state == NICE_COMPONENT_STATE_FAILED)
agent_signal_component_state_change (agent, stream->id, component->id,
NICE_COMPONENT_STATE_CONNECTING);
if (component->state < NICE_COMPONENT_STATE_CONNECTED)
if (component->state < NICE_COMPONENT_STATE_CONNECTED) {
nice_debug ("priv_update_check_list_state_for_ready CONNECTED HERE");
agent_signal_component_state_change (agent, stream->id, component->id,
NICE_COMPONENT_STATE_CONNECTED);
}
agent_signal_component_state_change (agent, stream->id,
component->id, NICE_COMPONENT_STATE_READY);
}
......@@ -2049,11 +2051,13 @@ static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Nice
if (component->state == NICE_COMPONENT_STATE_FAILED)
agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_CONNECTING);
if (component->state == NICE_COMPONENT_STATE_CONNECTING)
if (component->state == NICE_COMPONENT_STATE_CONNECTING) {
/* step: notify the client of a new component state (must be done
* before the possible check list state update step */
nice_debug ("priv_mark_pair_nominated 1 CONNECTED HERE");
agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_CONNECTED);
}
priv_update_check_list_state_for_ready (agent, stream, component);
} else if (pair->state == NICE_CHECK_IN_PROGRESS) {
pair->mark_nominated_on_response_arrival = TRUE;
......@@ -2082,11 +2086,13 @@ static void priv_mark_pair_nominated (NiceAgent *agent, NiceStream *stream, Nice
if (component->state == NICE_COMPONENT_STATE_FAILED)
agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_CONNECTING);
if (component->state == NICE_COMPONENT_STATE_CONNECTING)
if (component->state == NICE_COMPONENT_STATE_CONNECTING) {
/* step: notify the client of a new component state (must be done
* before the possible check list state update step */
nice_debug ("priv_mark_pair_nominated 2 CONNECTED HERE");
agent_signal_component_state_change (agent,
stream->id, component->id, NICE_COMPONENT_STATE_CONNECTED);
}
}
priv_update_check_list_state_for_ready (agent, stream, component);
}
......@@ -2219,6 +2225,7 @@ static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched (
initial_state);
if (component->state == NICE_COMPONENT_STATE_CONNECTED ||
component->state == NICE_COMPONENT_STATE_READY) {
nice_debug ("priv_conn_check_add_for_candidate_pair_matched CONNECTED HERE");
agent_signal_component_state_change (agent,
stream_id,
component->id,
......@@ -3451,11 +3458,13 @@ static gboolean priv_map_reply_to_conn_check_request (NiceAgent *agent, NiceStre
", got a nominated pair");
/* 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) {
nice_debug ("priv_map_reply_to_conn_check_request CONNECTED HERE");
/* 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
......
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