- command, connection_id = q.get(timeout=0.001)
- self.handle_input(connection_id, command)
+ connection_id, command = q.get(timeout=0.001)
+ now = int(time.time() * 10)
+ if connection_id in potential_flooders and \
+ potential_flooders[connection_id][0] == now:
+ if potential_flooders[connection_id][1] > 10:
+ continue
+ potential_flooders[connection_id][1] += 1
+ else:
+ potential_flooders[connection_id] = [now, 1]
+ self.handle_input(command, connection_id)