From ce1bdb7b638923e5f356a7a04263b6d186837ae8 Mon Sep 17 00:00:00 2001 From: Jefry Lagrange Date: Sat, 25 Aug 2012 11:14:38 -0400 Subject: [PATCH] calculate hash after we get session accept --- src/common/jingle_ft.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index 49d875f18..f9989c249 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -119,11 +119,7 @@ class JingleFileTransfer(JingleContent): self._listen_host() def __on_session_initiate_sent(self, stanza, content, error, action): - # Calculate file hash in a new thread - # if we haven't sent the hash already. - if self.file_props.hash_ is None: - self.hashThread = threading.Thread(target=self.__send_hash) - self.hashThread.start() + pass def __send_hash(self): # Send hash in a session info @@ -167,6 +163,11 @@ class JingleFileTransfer(JingleContent): self.__state_changed(STATE_TRANSFERING) raise xmpp.NodeProcessed 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: + self.hashThread = threading.Thread(target=self.__send_hash) + self.hashThread.start() for host in self.file_props.streamhosts: host['initiator'] = self.session.initiator host['target'] = self.session.responder