close FT port as soon as we know it won't be used for the transfer.

This commit is contained in:
Yann Leboulanger 2014-06-16 21:32:01 +02:00
parent d026f79428
commit ffaa6efbc7
2 changed files with 6 additions and 1 deletions

View File

@ -282,7 +282,8 @@ class JingleFileTransfer(JingleContent):
streamhost_used = cand
break
if streamhost_used == None or streamhost_used['type'] == 'proxy':
if not gajim.socks5queue.listener.connections:
if gajim.socks5queue.listener and \
not gajim.socks5queue.listener.connections:
gajim.socks5queue.listener.disconnect()
if content.getTag('transport').getTag('activated'):
self.state = STATE_TRANSFERING

View File

@ -151,9 +151,13 @@ class StateTransfering(JingleFileTransferStates):
if self.jft.isOurCandUsed():
mode = 'client'
streamhost_used = self.jft.nominated_cand['our-cand']
gajim.socks5queue.remove_server(self.jft.file_props.sid)
else:
mode = 'server'
streamhost_used = self.jft.nominated_cand['peer-cand']
gajim.socks5queue.remove_client(self.jft.file_props.sid)
# our_cand = self.jft.nominated_cand['our-cand']
# gajim.socks5queue.remove_receiver(our_cand['idx'])
if streamhost_used['type'] == 'proxy':
self.jft.file_props.is_a_proxy = True
if self.jft.file_props.type_ == 's' and self.jft.weinitiate: