Rework blocking.

Log attempts from banned servers and only block adds, not other
requests.
This commit is contained in:
Simon Howard 2016-06-12 21:23:05 -04:00
parent 118c62ba4b
commit c0975c8f53
1 changed files with 4 additions and 3 deletions

View File

@ -240,6 +240,10 @@ class MasterServer:
def process_add_to_master(self, addr):
""" Process an "add to master" request received from a server. """
if self.is_blocked(addr):
self.log_output(addr, "Ignoring add from banned server")
return
if addr in self.servers:
self.log_output(addr, "Refresh server")
server = self.servers[addr]
@ -377,9 +381,6 @@ class MasterServer:
data, addr = self.sock.recvfrom(1400)
if self.is_blocked(addr):
return
try:
self.process_packet(data, addr)
except Exception, e: