Commit 3070c8dc authored by Kai Vehmanen's avatar Kai Vehmanen
Browse files

Improved code commentary, refactoring of code.

darcs-hash:20070717182032-77cd4-87e42057b7b2132e60375c2a8e1debcf16e828a6.gz
parent 8b50079f
......@@ -519,7 +519,7 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
return;
if (component->state != state && state < NICE_COMPONENT_STATE_LAST) {
g_debug ("stream %u component %u state change %u -> %u.",
g_debug ("stream %u component %u STATE-CHANGE %u -> %u.",
stream_id, component_id, component->state, state);
component->state = state;
......@@ -528,23 +528,6 @@ void agent_signal_component_state_change (NiceAgent *agent, guint stream_id, gui
}
}
#if 0
static void priv_signal_component_state_connecting (NiceAgent *agent, guint stream_id, guint component_id)
{
Component *component;
if (!agent_find_component (agent, stream_id, component_id, NULL, &component))
return;
if (component->state != NICE_COMPONENT_STATE_CONNECTING) {
component->state = NICE_COMPONENT_STATE_CONNECTING;
g_signal_emit (agent, signals[SIGNAL_COMPONENT_STATE_CHANGED], 0,
stream_id, component_id, component->state);
}
}
#endif
static gboolean
priv_add_srv_rfx_candidate_discovery (NiceAgent *agent, NiceCandidate *host_candidate, const gchar *stun_server_ip, const guint stun_server_port, Stream *stream, guint component_id, NiceAddress *addr)
{
......@@ -608,10 +591,8 @@ nice_agent_add_stream (
if (modified_list) {
stream->id = agent->next_stream_id++;
g_debug ("allocating stream id %u (%p)", stream->id, stream);
/* note: generate ufrag/pwd for the stream (see ICE ID-15 15.4) */
nice_rng_generate_bytes_print (agent->rng, NICE_STREAM_DEF_UFRAG - 1, stream->local_ufrag);
nice_rng_generate_bytes_print (agent->rng, NICE_STREAM_DEF_PWD - 1, stream->local_password);
stream_initialize_credentials (stream, agent->rng);
agent->streams = modified_list;
}
......@@ -919,6 +900,10 @@ nice_agent_add_remote_candidate (
const gchar *username,
const gchar *password)
{
/* XXX: should we allow use of this method without an
* initial call to nice_agent_set_remote_candidates()
* with an empty set? */
return
priv_add_remote_candidate (agent,
stream_id,
......
......@@ -82,9 +82,11 @@ void discovery_free_item (gpointer data, gpointer user_data)
void discovery_free (NiceAgent *agent)
{
if (agent->discovery_list) {
g_slist_foreach (agent->discovery_list, discovery_free_item, NULL);
g_slist_free (agent->discovery_list),
agent->discovery_list = NULL;
GSList *tmp = agent->discovery_list;
agent->discovery_list = NULL;
g_slist_foreach (tmp, discovery_free_item, NULL);
g_slist_free (tmp);
agent->discovery_unsched_items = 0;
}
......
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