[Pkg-telepathy-commits] [libnice] 188/265: agent: Prevent nice_agent_set_port_range() from being called after a gather

Simon McVittie smcv at debian.org
Wed May 14 12:05:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository libnice.

commit 69ba4f4dc14c81b5c5d0b3ac5cb5ac76508a36ab
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Thu Mar 27 21:10:02 2014 -0400

    agent: Prevent nice_agent_set_port_range() from being called after a gather
    
    The port range is only used when gathering, print a critical if it is
    called afterwards as it will have no effect.
---
 agent/agent.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/agent/agent.c b/agent/agent.c
index fe32b27..7673e0f 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -2411,13 +2411,19 @@ NICEAPI_EXPORT void
 nice_agent_set_port_range (NiceAgent *agent, guint stream_id, guint component_id,
     guint min_port, guint max_port)
 {
+  Stream *stream;
   Component *component;
 
   agent_lock();
 
-  if (agent_find_component (agent, stream_id, component_id, NULL, &component)) {
-    component->min_port = min_port;
-    component->max_port = max_port;
+  if (agent_find_component (agent, stream_id, component_id, &stream,
+          &component)) {
+    if (stream->gathering_started) {
+      g_critical ("nice_agent_gather_candidates (stream_id=%u) already called for this stream", stream_id);
+    } else {
+      component->min_port = min_port;
+      component->max_port = max_port;
+    }
   }
 
   agent_unlock_and_emit (agent);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git



More information about the Pkg-telepathy-commits mailing list