only compare file hashes when we actually have a hash
This commit is contained in:
parent
8da4e91134
commit
d3048a0ac7
3 changed files with 4 additions and 3 deletions
|
@ -184,7 +184,8 @@ class JingleFileTransfer(JingleContent):
|
||||||
self.file_props.streamhosts = self.transport.remote_candidates
|
self.file_props.streamhosts = self.transport.remote_candidates
|
||||||
# Calculate file hash in a new thread
|
# Calculate file hash in a new thread
|
||||||
# if we haven't sent the hash already.
|
# 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 = threading.Thread(target=self.__send_hash)
|
||||||
self.hashThread.start()
|
self.hashThread.start()
|
||||||
for host in self.file_props.streamhosts:
|
for host in self.file_props.streamhosts:
|
||||||
|
|
|
@ -660,7 +660,7 @@ class FileTransfersWindow:
|
||||||
if transfered_size == full_size:
|
if transfered_size == full_size:
|
||||||
# If we are receiver and this is a jingle session
|
# If we are receiver and this is a jingle session
|
||||||
if file_props.type_ == 'r' and \
|
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
|
# Show that we are computing the hash
|
||||||
self.set_status(file_props, 'computing')
|
self.set_status(file_props, 'computing')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -985,7 +985,7 @@ class Interface:
|
||||||
if file_props.stalled or file_props.paused:
|
if file_props.stalled or file_props.paused:
|
||||||
return
|
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
|
# we compare hashes
|
||||||
if file_props.session_type == 'jingle':
|
if file_props.session_type == 'jingle':
|
||||||
# Compare hashes in a new thread
|
# Compare hashes in a new thread
|
||||||
|
|
Loading…
Add table
Reference in a new issue