Ticket #42 (closed defect: invalid)

Opened 20 months ago

Last modified 19 months ago

Rate controls not work

Reported by: smoku Owned by: smoku
Priority: major Component: General
Version: 2.1 Keywords:
Cc: Tracforge_linkmap:
Blocking: Blocked By:

Description

Set

<limits>

<connects seconds='60' throttle='600'>10</connects>

</limits>

Block always after 10 logins.


--- rate.c.orig 2002-11-04 07:52:26.000000000 +0300
+++ rate.c      2005-11-16 14:07:29.000000000 +0300
@@ -82,6 +82,15 @@

     now = time(NULL);

+    /* rate expired */
+    if(rt->count = rt->total){
+        if(now - rt->time >= rt->seconds)
+        {
+           rate_reset(rt);
+            return 1;
+        }
+    }
+
     /* currently bad */
     if(rt->bad != 0)
     {
@@ -96,12 +105,6 @@
         return 0;
     }

-    /* rate expired */
-    if(time(NULL) - rt->time >= rt->seconds)
-    {
-        rate_reset(rt);
-        return 1;
-    }

     /* they're inside the time, and not bad yet */
     return 1;

Change History

Changed 19 months ago by smoku

  • status changed from new to closed
  • resolution set to invalid

This is expected behavior.

When one triggers the penalty, one should be penalized for the time set, even if the check period is shorter.

In the example, penalty will hold for 600 seconds, even when the check is for 60 seconds time.

Note: See TracTickets for help on using tickets.