int throttle_add(struct sockaddr *addr);
int is_throttle_ip(struct sockaddr *addr);
unsigned long throttle_size(void);
+void flush_throttle(void);
#endif
}
+static void
+rehash_throttles(struct Client *source_p)
+{
+ sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is clearing throttles",
+ get_oper_name(source_p));
+ flush_throttle();
+
+}
+
static void
rehash_help(struct Client *source_p)
{
{"TXLINES", rehash_txlines },
{"TRESVS", rehash_tresvs },
{"REJECTCACHE", rehash_rejectcache },
+ {"THROTTLES", rehash_throttles },
{"HELP", rehash_help },
{"NICKDELAY", rehash_nickdelay },
{NULL, NULL }
return 0;
}
+void
+flush_throttle(void)
+{
+ rb_dlink_node *ptr, *next;
+ rb_patricia_node_t *pnode;
+ throttle_t *t;
+
+ RB_DLINK_FOREACH_SAFE(ptr, next, throttle_list.head)
+ {
+ pnode = ptr->data;
+ t = pnode->data;
+
+ rb_dlinkDelete(ptr, &throttle_list);
+ rb_free(t);
+ rb_patricia_remove(throttle_tree, pnode);
+ }
+}
+
static void
throttle_expires(void *unused)
{