summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-12-12 21:12:52 +0100
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2021-04-20 19:37:08 +0000
commitbbf7f2d7beb24c7d620e62c2030701e6961a29d4 (patch)
tree8f0a74552086ec59124baaec175cccdbfac3f204
parent8ccac4b04759edaecead7470e28865aff8066921 (diff)
downloadlibnice-bbf7f2d7beb24c7d620e62c2030701e6961a29d4.tar.gz
agent: warn when closing the agent with alive turn refreshes
This patch suggests the developer to close its alive reservations on the turn server before disposing the agent. Not removing reservations on the turn server, will make them alive until their default timeout, generally 300 seconds, which is not fair for the turn server resources, but also it may cause a fatal error 437, "Mismatched allocation: wrong transaction ID", when another agent tries to contact the same turn server using the same nat mapping before this delay expires.
-rw-r--r--agent/agent.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 40c2146..c15f835 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -5624,6 +5624,11 @@ nice_agent_dispose (GObject *object)
free_queued_signal (sig);
}
+ if (agent->refresh_list)
+ g_warning ("Agent %p : We still have alive TURN refreshes. Consider "
+ "using nice_agent_close_async() to prune them before releasing the "
+ "agent.", agent);
+
g_free (agent->stun_server_ip);
agent->stun_server_ip = NULL;