]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Only count throttle entries that cause rejection in /stats t.
authorJilles Tjoelker <redacted>
Tue, 16 Dec 2008 20:10:09 +0000 (21:10 +0100)
committerJilles Tjoelker <redacted>
Tue, 16 Dec 2008 20:10:09 +0000 (21:10 +0100)
src/reject.c

index f6d4b3d200f0bebd7bcce7e677bf074fd0637095..6e226ca5b37be6759bb73f984d45e7bc6f05adfa 100644 (file)
@@ -125,7 +125,21 @@ init_reject(void)
 unsigned long
 throttle_size(void)
 {
-       return rb_dlink_list_length(&throttle_list);
+       unsigned long count;
+       rb_dlink_node *ptr;
+       rb_patricia_node_t *pnode;
+       throttle_t *t;
+
+       count = 0;
+       RB_DLINK_FOREACH(ptr, throttle_list.head)
+       {
+               pnode = ptr->data;
+               t = pnode->data;
+               if (t->count > ConfigFileEntry.throttle_count)
+                       count++;
+       }
+
+       return count;
 }
 
 void