Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJefry Lagrange <jefry.reyes@gmail.com>2012-08-28 23:10:19 +0400
committerJefry Lagrange <jefry.reyes@gmail.com>2012-08-28 23:10:19 +0400
commit401f19282a90093f164d1eb79ec1cd83b0128d02 (patch)
treec988759dc67b092fb5b36b9f1af5706d2679e227
parent2bcc753c6754f4788ab24767f9222fadf8d037ed (diff)
dont connect to local host if ip is the same or if is loopback
-rw-r--r--src/common/jingle_transport.py3
-rw-r--r--src/common/socks5.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/common/jingle_transport.py b/src/common/jingle_transport.py
index 0328fca6a..224566a00 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 5ae658313..b6f0ab859 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: