mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 18:08:39 +00:00
Fix detecting localhost connection
This commit is contained in:
parent
fc25852e7b
commit
227115551d
1 changed files with 3 additions and 2 deletions
|
@ -28,6 +28,7 @@ import os.path
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
import httplib
|
import httplib
|
||||||
|
import urlparse
|
||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
|
@ -297,8 +298,8 @@ class BaseClient(object):
|
||||||
uri = self.core.get_core_uri()
|
uri = self.core.get_core_uri()
|
||||||
if uri != None:
|
if uri != None:
|
||||||
# Get the host
|
# Get the host
|
||||||
host = uri[7:].split(":")[0]
|
u = urlparse.urlsplit(uri)
|
||||||
if host == "localhost" or host == "127.0.0.1":
|
if u.hostname == "localhost" or u.hostname == "127.0.0.1":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue