From 67c28501af3f2a37f6a65b5ea994b7c2cc273db6 Mon Sep 17 00:00:00 2001 From: Jefry Lagrange Date: Sat, 25 Aug 2012 23:54:39 -0400 Subject: [PATCH] only send hash if contact supports it --- src/common/jingle.py | 5 ----- src/common/jingle_ft.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/jingle.py b/src/common/jingle.py index 57ca2ba06..07eaa6fcf 100644 --- a/src/common/jingle.py +++ b/src/common/jingle.py @@ -80,12 +80,10 @@ class ConnectionJingle(object): # get data jid = helpers.get_full_jid_from_iq(stanza) id_ = stanza.getID() - if (jid, id_) in self.__iq_responses.keys(): self.__iq_responses[(jid, id_)].on_stanza(stanza) del self.__iq_responses[(jid, id_)] raise xmpp.NodeProcessed - jingle = stanza.getTag('jingle') # a jingle element is not necessary in iq-result stanza # don't check for that @@ -97,14 +95,12 @@ class ConnectionJingle(object): if id_ in sesn.iq_ids: sesn.on_stanza(stanza) return - # do we need to create a new jingle object if sid not in self._sessions: #TODO: tie-breaking and other things... newjingle = JingleSession(con=self, weinitiate=False, jid=jid, iq_id=id_, sid=sid) self._sessions[sid] = newjingle - # we already have such session in dispatcher... self._sessions[sid].collect_iq_id(id_) self._sessions[sid].on_stanza(stanza) @@ -112,7 +108,6 @@ class ConnectionJingle(object): if sid in self._sessions and \ self._sessions[sid].state == JingleStates.ended: self.delete_jingle_session(sid) - raise xmpp.NodeProcessed def start_audio(self, jid): diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index 0405a68ee..25d1d0b4f 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -166,7 +166,7 @@ class JingleFileTransfer(JingleContent): self.file_props.streamhosts = self.transport.remote_candidates # Calculate file hash in a new thread # if we haven't sent the hash already. - if self.file_props.hash_ is None: + if self.file_props.hash_ is None and self.file_props.algo: self.hashThread = threading.Thread(target=self.__send_hash) self.hashThread.start() for host in self.file_props.streamhosts: