Commit 8c0ad69d authored by Youness Alaoui's avatar Youness Alaoui

free ufrag and password returned by get_local_credentials

parent 282e8dae
...@@ -390,13 +390,17 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas ...@@ -390,13 +390,17 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
/* step: pass the remote candidates to agents */ /* step: pass the remote candidates to agents */
//cands = g_slist_append (NULL, &cdes); //cands = g_slist_append (NULL, &cdes);
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, ufrag, password); rs_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
/* cdes.component_id = NICE_COMPONENT_TYPE_RTP; /* cdes.component_id = NICE_COMPONENT_TYPE_RTP;
cdes.addr = raddr; cdes.addr = raddr;
...@@ -544,13 +548,17 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N ...@@ -544,13 +548,17 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
/* step: pass the remote candidates to agent R (answering party) */ /* step: pass the remote candidates to agent R (answering party) */
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, ufrag, password); rs_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
/* step: set remote candidates for agent R (answering party) */ /* step: set remote candidates for agent R (answering party) */
cands = g_slist_append (NULL, &cdes); cands = g_slist_append (NULL, &cdes);
...@@ -574,13 +582,17 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N ...@@ -574,13 +582,17 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
/* step: pass the remote candidates to agent L (offering party) */ /* step: pass the remote candidates to agent L (offering party) */
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
/* step: pass remove candidates to agent L (offering party) */ /* step: pass remove candidates to agent L (offering party) */
...@@ -698,19 +710,25 @@ static int run_full_test_wrong_password (NiceAgent *lagent, NiceAgent *ragent, N ...@@ -698,19 +710,25 @@ static int run_full_test_wrong_password (NiceAgent *lagent, NiceAgent *ragent, N
raddr = cand->addr; raddr = cand->addr;
} }
} }
for (i = cands; i; i = i->next)
nice_candidate_free ((NiceCandidate *) i->data);
g_slist_free (cands); g_slist_free (cands);
g_debug ("test-fullmode: Got local candidates..."); g_debug ("test-fullmode: Got local candidates...");
/* step: pass the remote candidates to agents */ /* step: pass the remote candidates to agents */
cands = g_slist_append (NULL, &cdes); cands = g_slist_append (NULL, &cdes);
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, "wrong", password); rs_id, "wrong", password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, "wrong2"); ls_id, ufrag, "wrong2");
g_free (ufrag);
g_free (password);
} }
cdes.addr = raddr; cdes.addr = raddr;
nice_agent_set_remote_candidates (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cands); nice_agent_set_remote_candidates (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cands);
...@@ -819,19 +837,25 @@ static int run_full_test_control_conflict (NiceAgent *lagent, NiceAgent *ragent, ...@@ -819,19 +837,25 @@ static int run_full_test_control_conflict (NiceAgent *lagent, NiceAgent *ragent,
raddr = cand->addr; raddr = cand->addr;
} }
} }
for (i = cands; i; i = i->next)
nice_candidate_free ((NiceCandidate *) i->data);
g_slist_free (cands); g_slist_free (cands);
g_debug ("test-fullmode: Got local candidates..."); g_debug ("test-fullmode: Got local candidates...");
/* step: pass the remote candidates to agents */ /* step: pass the remote candidates to agents */
cands = g_slist_append (NULL, &cdes); cands = g_slist_append (NULL, &cdes);
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, ufrag, password); rs_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
cdes.addr = raddr; cdes.addr = raddr;
nice_agent_set_remote_candidates (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cands); nice_agent_set_remote_candidates (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cands);
......
...@@ -276,13 +276,17 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress * ...@@ -276,13 +276,17 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
/* step: pass the remote candidates to agents */ /* step: pass the remote candidates to agents */
cands = g_slist_append (NULL, &cdes); cands = g_slist_append (NULL, &cdes);
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, ufrag, password); rs_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
cdes.component_id = NICE_COMPONENT_TYPE_RTP; cdes.component_id = NICE_COMPONENT_TYPE_RTP;
cdes.addr = raddr; cdes.addr = raddr;
...@@ -328,13 +332,17 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress * ...@@ -328,13 +332,17 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
g_assert (tie_breaker != ragent->tie_breaker); g_assert (tie_breaker != ragent->tie_breaker);
nice_agent_restart (lagent); nice_agent_restart (lagent);
{ {
const gchar *ufrag = NULL, *password = NULL; gchar *ufrag = NULL, *password = NULL;
nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password); nice_agent_get_local_credentials(lagent, ls_id, &ufrag, &password);
nice_agent_set_remote_credentials (ragent, nice_agent_set_remote_credentials (ragent,
rs_id, ufrag, password); rs_id, ufrag, password);
g_free (ufrag);
g_free (password);
nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password); nice_agent_get_local_credentials(ragent, rs_id, &ufrag, &password);
nice_agent_set_remote_credentials (lagent, nice_agent_set_remote_credentials (lagent,
ls_id, ufrag, password); ls_id, ufrag, password);
g_free (ufrag);
g_free (password);
} }
/* send another packet after restart */ /* send another packet after restart */
......
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