Commit eae437db authored by Dafydd Harries's avatar Dafydd Harries

set port to 0 on local addresses so that unique port is allocated for new candidates

darcs-hash:20070208132831-c9803-72d9230c52fd9a9b8eec069039535d35e7afd955.gz
parent 0cfa532d
......@@ -253,8 +253,11 @@ nice_agent_add_stream (
void
nice_agent_add_local_address (NiceAgent *agent, NiceAddress *addr)
{
agent->local_addresses = g_slist_append (agent->local_addresses,
nice_address_dup (addr));
NiceAddress *dup;
dup = nice_address_dup (addr);
dup->port = 0;
agent->local_addresses = g_slist_append (agent->local_addresses, dup);
/* XXX: Should we generate local candidates for existing streams at this
* point, or require that local addresses are set before media streams are
......
......@@ -27,8 +27,6 @@ main (void)
nice_udp_fake_socket_factory_init (&factory);
g_assert (nice_address_set_ipv4_from_string (&addr_local, "192.168.0.1"));
/* fake socket manager uses incremental port numbers starting at 1 */
addr_local.port = 1;
g_assert (nice_address_set_ipv4_from_string (&addr_remote, "192.168.0.2"));
addr_remote.port = 2345;
......@@ -54,6 +52,8 @@ main (void)
g_assert (agent->local_candidates != NULL);
g_assert (g_slist_length (agent->local_candidates) == 1);
candidate = agent->local_candidates->data;
/* fake socket manager uses incremental port numbers starting at 1 */
addr_local.port = 1;
g_assert (nice_address_equal (&(candidate->addr), &addr_local));
g_assert (candidate->id == 1);
......
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