don't forget to send candidate-error when we get only a local IP

This commit is contained in:
Yann Leboulanger 2012-08-30 23:45:35 +02:00
parent 41e1c557af
commit f22a889845
1 changed files with 7 additions and 3 deletions

View File

@ -118,14 +118,18 @@ class SocksQueue:
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
streamhosts_to_test = []
# Remove local IPs to not connect to ourself
for streamhost in file_props.streamhosts:
if streamhost['host'] == '127.0.0.1' or \
streamhost['host'] == '::1' or \
streamhost['host'] == con.peerhost[0]:
continue
streamhosts_to_test.append(streamhost)
if not streamhosts_to_test:
on_failure(file_props.sid)
# add streamhosts to the queue
for streamhost in streamhosts_to_test:
if 'type' in streamhost and streamhost['type'] == 'proxy':
fp = None
else: