From d3048a0ac759066fa762851f16713d53562685a2 Mon Sep 17 00:00:00 2001 From: Jefry Lagrange Date: Sat, 13 Oct 2012 14:31:16 -0400 Subject: [PATCH] only compare file hashes when we actually have a hash --- src/common/jingle_ft.py | 3 ++- src/filetransfers_window.py | 2 +- src/gui_interface.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index ae214b38e..101e93310 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -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: diff --git a/src/filetransfers_window.py b/src/filetransfers_window.py index 04d7c18ee..8db9bf24e 100644 --- a/src/filetransfers_window.py +++ b/src/filetransfers_window.py @@ -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: diff --git a/src/gui_interface.py b/src/gui_interface.py index 1259068ad..b231087c3 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -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