Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eggdrop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,11 @@ set extended-join 1
# 512 bytes/2 seconds.
set msg-rate 2

# Limit messages to server to n messages / n seconds. Most IRC servers have a
# threashold of 5. Only rise this value if you know what you are doing or
# risk excess flood kill.
set burst-rate 5

# This setting makes the bot try to get his original nickname back if its
# primary nickname is already in use.
set keep-nick 1
Expand Down
10 changes: 6 additions & 4 deletions src/mod/server.mod/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ static char cap_request[CAPMAX - 9];
static int maxqmsg;
static struct msgq_head mq, hq, modeq;
static int burst;
static int burstrate;

#include "cmdsserv.c"
#include "tclserv.c"
Expand Down Expand Up @@ -189,9 +190,9 @@ static void deq_msg()
if (serv < 0)
return;

/* Send up to 4 msgs to server if the *critical queue* has anything in it */
/* Send up to 5 msgs to server if the *critical queue* has anything in it */
if (modeq.head) {
while (modeq.head && (burst < 4) && ((last_time - now) < MAXPENALTY)) {
while (modeq.head && (burst < burstrate) && ((last_time - now) < MAXPENALTY)) {
if (deq_kick(DP_MODE)) {
burst++;
continue;
Expand Down Expand Up @@ -219,8 +220,7 @@ static void deq_msg()
return;
}

/* Send something from the normal msg q even if we're slightly bursting */
if (burst > 1)
if (modeq.head || (!modeq.head && (burst >= burstrate)))
return;

if (mq.head) {
Expand Down Expand Up @@ -1772,6 +1772,7 @@ static tcl_ints my_tcl_ints[] = {
{"extended-join", &extended_join, 0},
{"account-notify", &account_notify, 0},
{"account-tag", &account_tag, 0},
{"burst-rate", &burstrate, 0},
{NULL, NULL, 0}
};

Expand Down Expand Up @@ -2431,6 +2432,7 @@ char *server_start(Function *global_funcs)
#ifdef TLS
tls_vfyserver = 0;
#endif
burstrate = 5;

server_table[4] = (Function) botname;
module_register(MODULE_NAME, server_table, 1, 5);
Expand Down