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

only compare file hashes when we actually have a hash

parent 8da4e911
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,8 @@ 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 and self.file_props.algo:
if self.file_props.hash_ is None and self.file_props.algo and \
not self.werequest:
self.hashThread = threading.Thread(target=self.__send_hash)
self.hashThread.start()
for host in self.file_props.streamhosts:
......
......@@ -660,7 +660,7 @@ class FileTransfersWindow:
if transfered_size == full_size:
# If we are receiver and this is a jingle session
if file_props.type_ == 'r' and \
file_props.session_type == 'jingle':
file_props.session_type == 'jingle' and file_props.hash_:
# Show that we are computing the hash
self.set_status(file_props, 'computing')
else:
......
......@@ -985,7 +985,7 @@ class Interface:
if file_props.stalled or file_props.paused:
return
if file_props.type_ == 'r': # we receive a file
if file_props.type_ == 'r' and file_props.hash_: # we receive a file
# we compare hashes
if file_props.session_type == 'jingle':
# Compare hashes in a new thread
......
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