mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
Fix the display of the tracker host when it's an IP address and not a
hostname
This commit is contained in:
parent
2edf1fc692
commit
81b895bd1d
2 changed files with 11 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
Deluge 1.1.0_RC3 (05 January 2009)
|
||||
Core:
|
||||
* Fix applying proxy settings
|
||||
* Fix the display of the tracker host when it's an IP address and not a hostname
|
||||
|
||||
GtkUI:
|
||||
* Fix folder renaming to display the change properly
|
||||
|
|
|
@ -519,6 +519,16 @@ class Torrent:
|
|||
url = urlparse(tracker)
|
||||
if hasattr(url, "hostname"):
|
||||
host = (url.hostname or 'DHT')
|
||||
# Check if hostname is an IP address and just return it if that's the case
|
||||
import socket
|
||||
try:
|
||||
socket.inet_aton(url.hostname)
|
||||
except socket.error:
|
||||
pass
|
||||
else:
|
||||
# This is an IP address because an exception wasn't raised
|
||||
return url.hostname
|
||||
|
||||
parts = host.split(".")
|
||||
if len(parts) > 2:
|
||||
if parts[-2] in ("co", "com"):
|
||||
|
|
Loading…
Add table
Reference in a new issue