From c0975c8f538b6b9149db00aa3f2b3c6fcd9e656c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 12 Jun 2016 21:23:05 -0400 Subject: [PATCH] Rework blocking. Log attempts from banned servers and only block adds, not other requests. --- chocolate-master | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chocolate-master b/chocolate-master index 796d0ed..d26cd36 100755 --- a/chocolate-master +++ b/chocolate-master @@ -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: