account for ipv6 brackets [ip:ip:ip]:port

This commit is contained in:
Marcos Pinto 2008-10-18 04:48:38 +00:00
parent 37618e4a13
commit 219be3f440
1 changed files with 8 additions and 2 deletions

View File

@ -154,6 +154,12 @@ def add_peer_dialog():
response = peer_dialog.run()
if response:
value = txt_ip.get_text()
if ']' in value:
#ipv6
ip = value.split("]")[0][1:]
port = value.split("]")[1][1:]
else:
#ipv4
ip = value.split(":")[0]
port = value.split(":")[1]
if deluge.common.is_ip(ip):