Allow tracker connection to loopback to same client
This commit is contained in:
parent
e05c432d14
commit
ca3b01f898
1 changed files with 4 additions and 1 deletions
|
@ -342,6 +342,9 @@ class Connection(object):
|
||||||
elif self.ip.endswith(".onion"):
|
elif self.ip.endswith(".onion"):
|
||||||
handshake["onion"] = self.server.tor_manager.getOnion("global")
|
handshake["onion"] = self.server.tor_manager.getOnion("global")
|
||||||
|
|
||||||
|
if self.is_tracker_connection:
|
||||||
|
handshake["tracker_connection"] = True
|
||||||
|
|
||||||
if config.debug_socket:
|
if config.debug_socket:
|
||||||
self.log("My Handshake: %s" % handshake)
|
self.log("My Handshake: %s" % handshake)
|
||||||
|
|
||||||
|
@ -351,7 +354,7 @@ class Connection(object):
|
||||||
if config.debug_socket:
|
if config.debug_socket:
|
||||||
self.log("Remote Handshake: %s" % handshake)
|
self.log("Remote Handshake: %s" % handshake)
|
||||||
|
|
||||||
if handshake.get("peer_id") == self.server.peer_id:
|
if handshake.get("peer_id") == self.server.peer_id and not handshake.get("tracker_connection") and not self.is_tracker_connection:
|
||||||
self.close("Same peer id, can't connect to myself")
|
self.close("Same peer id, can't connect to myself")
|
||||||
self.server.peer_blacklist.append((handshake["target_ip"], handshake["fileserver_port"]))
|
self.server.peer_blacklist.append((handshake["target_ip"], handshake["fileserver_port"]))
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue