Commit bde24e05 authored by Olivier Crête's avatar Olivier Crête Committed by Youness Alaoui

Use thread-safe version of GUPnP Simple IGD

parent 07e83589
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#include "stun/usages/ice.h" #include "stun/usages/ice.h"
#ifdef HAVE_GUPNP #ifdef HAVE_GUPNP
#include <libgupnp-igd/gupnp-simple-igd.h> #include <libgupnp-igd/gupnp-simple-igd-thread.h>
#endif #endif
/* XXX: starting from ICE ID-18, Ta SHOULD now be set according /* XXX: starting from ICE ID-18, Ta SHOULD now be set according
...@@ -113,7 +113,7 @@ struct _NiceAgent ...@@ -113,7 +113,7 @@ struct _NiceAgent
NiceCompatibility compatibility; /* property: Compatibility mode */ NiceCompatibility compatibility; /* property: Compatibility mode */
StunAgent stun_agent; /* STUN agent */ StunAgent stun_agent; /* STUN agent */
#ifdef HAVE_GUPNP #ifdef HAVE_GUPNP
GUPnPSimpleIgd* upnp; /* GUPnP Single IGD agent */ GUPnPSimpleIgdThread* upnp; /* GUPnP Single IGD agent */
gboolean upnp_enabled; /* whether UPnP discovery is enabled */ gboolean upnp_enabled; /* whether UPnP discovery is enabled */
guint upnp_timeout; /* UPnP discovery timeout */ guint upnp_timeout; /* UPnP discovery timeout */
GSList *upnp_mapping; /* list of Candidates being mapped */ GSList *upnp_mapping; /* list of Candidates being mapped */
......
...@@ -1286,7 +1286,7 @@ nice_agent_gather_candidates ( ...@@ -1286,7 +1286,7 @@ nice_agent_gather_candidates (
priv_free_upnp (agent); priv_free_upnp (agent);
if (agent->upnp_enabled) { if (agent->upnp_enabled) {
agent->upnp = gupnp_simple_igd_new (agent->main_context); agent->upnp = gupnp_simple_igd_thread_new ();
agent->upnp_timer_source = agent_timeout_add_with_context (agent, agent->upnp_timer_source = agent_timeout_add_with_context (agent,
agent->upnp_timeout, priv_upnp_timeout_cb, agent); agent->upnp_timeout, priv_upnp_timeout_cb, agent);
...@@ -1349,7 +1349,7 @@ nice_agent_gather_candidates ( ...@@ -1349,7 +1349,7 @@ nice_agent_gather_candidates (
NiceAddress *addr = nice_address_dup (&host_candidate->base_addr); NiceAddress *addr = nice_address_dup (&host_candidate->base_addr);
nice_debug ("Agent %p: Adding UPnP port %s:%d", agent, local_ip, nice_debug ("Agent %p: Adding UPnP port %s:%d", agent, local_ip,
nice_address_get_port (&host_candidate->base_addr)); nice_address_get_port (&host_candidate->base_addr));
gupnp_simple_igd_add_port (agent->upnp, "UDP", gupnp_simple_igd_add_port (GUPNP_SIMPLE_IGD (agent->upnp), "UDP",
0, local_ip, nice_address_get_port (&host_candidate->base_addr), 0, local_ip, nice_address_get_port (&host_candidate->base_addr),
0, PACKAGE_STRING); 0, PACKAGE_STRING);
agent->upnp_mapping = g_slist_prepend (agent->upnp_mapping, addr); agent->upnp_mapping = g_slist_prepend (agent->upnp_mapping, addr);
......
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