changeset 1245:5b6031179fef

allow disabling surge protection by surge_action_limits = None
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 14 Aug 2006 16:50:43 +0200
parents c0f994eb1455
children 5a806f10c810
files MoinMoin/request/__init__.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Mon Aug 14 13:14:13 2006 +0200
+++ b/MoinMoin/request/__init__.py	Mon Aug 14 16:50:43 2006 +0200
@@ -220,13 +220,16 @@
 
     def surge_protect(self):
         """ check if someone requesting too much from us """
+        limits = self.cfg.surge_action_limits
+        if not limits:
+            return False
+                                    
         validuser = self.user.valid
         current_id = validuser and self.user.name or self.remote_addr
         if not validuser and current_id.startswith('127.'): # localnet
             return False
         current_action = self.action
 
-        limits = self.cfg.surge_action_limits
         default_limit = self.cfg.surge_action_limits.get('default', (30, 60))
 
         now = int(time.time())