Commit 41ab61de authored by Mike Ruprecht's avatar Mike Ruprecht Committed by Philip Withnall

agent: Fix not setting UPnP timeout on second gather_candidates()

If the first call to nice_agent_gather_candidates() partially succeeds
(setting a UPnP agent and timeout), then fails before starting
gathering, a second call to nice_agent_gather_candidates() would fail to
set a new UPnP timeout because the UPnP initialisation block would be
skipped. That means gathering would never succeed due to timing out on
UPnP.

Fix that by setting the UPnP timeout whenever a new pending UPnP mapping
is added.

https://phabricator.freedesktop.org/T3534Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
parent 9638bc13
......@@ -2659,9 +2659,6 @@ nice_agent_gather_candidates (
agent->upnp = gupnp_simple_igd_thread_new ();
if (agent->upnp) {
agent_timeout_add_with_context (agent, &agent->upnp_timer_source,
"UPnP timeout", agent->upnp_timeout, priv_upnp_timeout_cb, agent);
g_signal_connect (agent->upnp, "mapped-external-port",
G_CALLBACK (_upnp_mapped_external_port), agent);
g_signal_connect (agent->upnp, "error-mapping-port",
......@@ -2808,6 +2805,9 @@ nice_agent_gather_candidates (
0, local_ip, nice_address_get_port (base_addr),
0, PACKAGE_STRING);
agent->upnp_mapping = g_slist_prepend (agent->upnp_mapping, base_addr);
agent_timeout_add_with_context (agent, &agent->upnp_timer_source,
"UPnP timeout", agent->upnp_timeout, priv_upnp_timeout_cb, agent);
}
#endif
......
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