diff --git a/src/common/jingle_transport.py b/src/common/jingle_transport.py index 0328fca6a137b52a393682bb578408a9b8e47752..224566a007a6b25ff424baed7206016e9ed0d1c0 100644 --- a/src/common/jingle_transport.py +++ b/src/common/jingle_transport.py @@ -177,7 +177,8 @@ class JingleTransportSocks5(JingleTransport): return local_ip_cand = [] port = int(gajim.config.get('file_transfers_port')) - type_preference = 126 #type preference of connection type. XEP-0260 section 2.2 + #type preference of connection type. XEP-0260 section 2.2 + type_preference = 126 c = {'host': self.connection.peerhost[0]} c['candidate_id'] = self.connection.connection.getAnID() c['port'] = port diff --git a/src/common/socks5.py b/src/common/socks5.py index 5ae65831329fa63fc213533c99074bcdd1061cdb..b6f0ab8596fc62876d110a8b28632d151229e789 100644 --- a/src/common/socks5.py +++ b/src/common/socks5.py @@ -34,6 +34,7 @@ from errno import EINPROGRESS from errno import EAFNOSUPPORT from xmpp.idlequeue import IdleObject from file_props import FilesProp +from common import gajim import jingle_xtls if jingle_xtls.PYOPENSSL_PRESENT: import OpenSSL @@ -116,10 +117,15 @@ class SocksQueue: self.on_failure[sid] = on_failure file_props = FilesProp.getFileProp(account, sid) file_props.failure_cb = on_failure + con = gajim.connections[account] if not file_props.streamhosts: on_failure(file_props.sid) # add streamhosts to the queue for streamhost in file_props.streamhosts: + if streamhost['host'] == '127.0.0.1' or \ + streamhost['host'] == '::1' or \ + streamhost['host'] == con.peerhost[0]: + continue if 'type' in streamhost and streamhost['type'] == 'proxy': fp = None else: