mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 00:18:39 +00:00
Fix #2171 : Add Peer dialog stops responding if empty or invalid values entered
This commit is contained in:
parent
47958f708f
commit
0a36baa7d7
1 changed files with 12 additions and 11 deletions
|
@ -385,16 +385,17 @@ class PeersTab(Tab):
|
||||||
response = peer_dialog.run()
|
response = peer_dialog.run()
|
||||||
if response:
|
if response:
|
||||||
value = txt_ip.get_text()
|
value = txt_ip.get_text()
|
||||||
if ']' in value:
|
if value and ':' in value:
|
||||||
#ipv6
|
if ']' in value:
|
||||||
ip = value.split("]")[0][1:]
|
#ipv6
|
||||||
port = value.split("]")[1][1:]
|
ip = value.split("]")[0][1:]
|
||||||
else:
|
port = value.split("]")[1][1:]
|
||||||
#ipv4
|
else:
|
||||||
ip = value.split(":")[0]
|
#ipv4
|
||||||
port = value.split(":")[1]
|
ip = value.split(":")[0]
|
||||||
if deluge.common.is_ip(ip):
|
port = value.split(":")[1]
|
||||||
log.debug("adding peer %s to %s", value, self.torrent_id)
|
if deluge.common.is_ip(ip):
|
||||||
client.core.connect_peer(self.torrent_id, ip, port)
|
log.debug("adding peer %s to %s", value, self.torrent_id)
|
||||||
|
client.core.connect_peer(self.torrent_id, ip, port)
|
||||||
peer_dialog.destroy()
|
peer_dialog.destroy()
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue