From 6402505983ec451b77648e3a082001ee9aced47d Mon Sep 17 00:00:00 2001 From: Jefry Lagrange Date: Fri, 22 Jul 2011 18:00:29 -0400 Subject: [PATCH] fix candidate-error --- src/common/jingle_content.py | 2 +- src/common/jingle_transport.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index 005d45831..dcc7e5bf8 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -145,7 +145,7 @@ class JingleContent(object): Sends a candidate-error when we can't connect to a candidate. """ content = self.__content() - tp = self.transport.make_transport() + tp = self.transport.make_transport(add_candidates=False) tp.addChild(name='candidate-error') content.addChild(node=tp) self.session.send_transport_info(content) diff --git a/src/common/jingle_transport.py b/src/common/jingle_transport.py index 3cd191d21..8db288b48 100644 --- a/src/common/jingle_transport.py +++ b/src/common/jingle_transport.py @@ -117,11 +117,14 @@ class JingleTransportSocks5(JingleTransport): return xmpp.Node('candidate', attrs=attrs) - def make_transport(self, candidates=None): - self._add_local_ips_as_candidates() - self._add_additional_candidates() - self._add_proxy_candidates() - transport = JingleTransport.make_transport(self, candidates) + def make_transport(self, candidates=None, add_candidates = True): + if add_candidates: + self._add_local_ips_as_candidates() + self._add_additional_candidates() + self._add_proxy_candidates() + transport = JingleTransport.make_transport(self, candidates) + else: + transport = xmpp.Node('transport') transport.setNamespace(xmpp.NS_JINGLE_BYTESTREAM) transport.setAttr('sid', self.sid) return transport