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

dont connect to local host if ip is the same or if is loopback

parent 2bcc753c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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:
......
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