use netifaces to get local IPs if available. Fixes #8666

This commit is contained in:
Yann Leboulanger 2017-08-14 16:43:44 +02:00
parent dbbd3fe111
commit b9c363e9cd
2 changed files with 5 additions and 1 deletions

1
README
View file

@ -38,6 +38,7 @@
<li>gir1.2-gupnpigd-1.0 for better NAT traversing</li> <li>gir1.2-gupnpigd-1.0 for better NAT traversing</li>
<li>gir1.2-networkmanager-1.0 for network lose detection</li> <li>gir1.2-networkmanager-1.0 for network lose detection</li>
<li>python3-idna and python3-precis-i18n for correctly parsing JIDs</li> <li>python3-idna and python3-precis-i18n for correctly parsing JIDs</li>
<li>python3-netifaces to get local IPs to send files</li>
</ul> </ul>
<p>Some distributions also split too much python standard library. I know SUSE does. In such distros you also need python-xml the xml lib that *comes* with python and not pyxml or whatever.</p> <p>Some distributions also split too much python standard library. I know SUSE does. In such distros you also need python-xml the xml lib that *comes* with python and not pyxml or whatever.</p>

View file

@ -205,6 +205,8 @@ class SocksQueue:
connection failure cb. If there are some which are still not connected connection failure cb. If there are some which are still not connected
try to establish connection to one of them try to establish connection to one of them
""" """
print(client)
print(streamhost)
self.idlequeue.remove_timeout(client.fd) self.idlequeue.remove_timeout(client.fd)
self.idlequeue.unplug_idle(client.fd) self.idlequeue.unplug_idle(client.fd)
file_props = client.file_props file_props = client.file_props
@ -223,7 +225,7 @@ class SocksQueue:
host['state'] = 0 host['state'] = 0
# FIXME: make the sender reconnect also # FIXME: make the sender reconnect also
client = Socks5ReceiverClient(self.idlequeue, host, client = Socks5ReceiverClient(self.idlequeue, host,
host['sid'], file_props) client.sid, file_props)
self.add_sockobj(client.account, client) self.add_sockobj(client.account, client)
host['idx'] = client.queue_idx host['idx'] = client.queue_idx
# we still have chances to connect # we still have chances to connect
@ -1031,6 +1033,7 @@ class Socks5Receiver(IdleObject):
self.connect_timeout = 0 self.connect_timeout = 0
self.connected = False self.connected = False
self.pauses = 0 self.pauses = 0
self.sid = sid
self.file_props = file_props self.file_props = file_props
self.file_props.disconnect_cb = self.disconnect self.file_props.disconnect_cb = self.disconnect
self.file_props.error = 0 self.file_props.error = 0