Skip to content
Snippets Groups Projects
Commit ce1bdb7b authored by zimio's avatar zimio
Browse files

calculate hash after we get session accept

parent b1c82b0b
No related branches found
No related tags found
No related merge requests found
...@@ -119,11 +119,7 @@ class JingleFileTransfer(JingleContent): ...@@ -119,11 +119,7 @@ class JingleFileTransfer(JingleContent):
self._listen_host() self._listen_host()
def __on_session_initiate_sent(self, stanza, content, error, action): def __on_session_initiate_sent(self, stanza, content, error, action):
# Calculate file hash in a new thread pass
# 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()
def __send_hash(self): def __send_hash(self):
# Send hash in a session info # Send hash in a session info
...@@ -167,6 +163,11 @@ class JingleFileTransfer(JingleContent): ...@@ -167,6 +163,11 @@ class JingleFileTransfer(JingleContent):
self.__state_changed(STATE_TRANSFERING) self.__state_changed(STATE_TRANSFERING)
raise xmpp.NodeProcessed raise xmpp.NodeProcessed
self.file_props.streamhosts = self.transport.remote_candidates 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: for host in self.file_props.streamhosts:
host['initiator'] = self.session.initiator host['initiator'] = self.session.initiator
host['target'] = self.session.responder host['target'] = self.session.responder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment