Ignore incoming connections in offline mode

This commit is contained in:
shortcutme 2019-04-15 15:47:05 +02:00
parent b8879853d5
commit 2326cf3de8
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -119,6 +119,10 @@ class ConnectionServer(object):
connection.close("Close all connections") connection.close("Close all connections")
def handleIncomingConnection(self, sock, addr): def handleIncomingConnection(self, sock, addr):
if config.offline:
sock.close()
return False
ip, port = addr[0:2] ip, port = addr[0:2]
ip = ip.lower() ip = ip.lower()
if ip.startswith("::ffff:"): # IPv6 to IPv4 mapping if ip.startswith("::ffff:"): # IPv6 to IPv4 mapping