From ca9d0abe4bf9c538ccebea3d707a95cb3f4268b6 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 24 Sep 2015 14:31:27 +0100 Subject: [PATCH] [GTKUI] Fix connected issue in connection manager * If host was not an ip address then it would not show as connected --- deluge/ui/gtkui/connectionmanager.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py index d9f1fe6c6..7482835a0 100644 --- a/deluge/ui/gtkui/connectionmanager.py +++ b/deluge/ui/gtkui/connectionmanager.py @@ -14,6 +14,7 @@ import time import gtk from twisted.internet import reactor +from socket import gethostbyname import deluge.component as component from deluge.common import resource_filename @@ -324,9 +325,11 @@ class ConnectionManager(component.Component): port = row[HOSTLIST_COL_PORT] user = row[HOSTLIST_COL_USER] - if (client.connected() and - (host, port, "localclient" if not user and host in ("127.0.0.1", "localhost") else user) - == client.connection_info()): + if client.connected() and ( + gethostbyname(host), + port, + "localclient" if not user and host in ("127.0.0.1", "localhost") else user + ) == client.connection_info(): def on_info(info): if not self.running: return