From 84bfb8ccb31b3ea5a083d0f51b249bba7e62a0b0 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 16 Dec 2008 21:10:09 +0100 Subject: [PATCH] Only count throttle entries that cause rejection in /stats t. --- src/reject.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/reject.c b/src/reject.c index f6d4b3d..6e226ca 100644 --- a/src/reject.c +++ b/src/reject.c @@ -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