summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd_io.h5
-rw-r--r--src/command_parse.cpp2
-rw-r--r--src/inspircd_io.cpp11
3 files changed, 16 insertions, 2 deletions
diff --git a/include/inspircd_io.h b/include/inspircd_io.h
index 0ef477ab5..da592d6c4 100644
--- a/include/inspircd_io.h
+++ b/include/inspircd_io.h
@@ -197,6 +197,11 @@ class ServerConfig : public classbase
*/
unsigned int SoftLimit;
+ /** Maximum number of targets for a multi target command
+ * such as PRIVMSG or KICK
+ */
+ unsigned int MaxTargets;
+
/** The maximum number of /WHO results allowed
* in any single /WHO command.
*/
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index eaf596a98..82f7df279 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -168,7 +168,7 @@ int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec
plist[i] = '\0';
strlcpy(blog[j++],param,MAXBUF);
param = plist+i+1;
- if (j>20)
+ if (j > Config->MaxTargets)
{
WriteServ(u->fd,"407 %s %s :Too many targets in list, message not delivered.",u->nick,blog[j-1]);
return 1;
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index bb7691ce5..897bc5aab 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -53,6 +53,7 @@ ServerConfig::ServerConfig()
unlimitcore = false;
AllowHalfop = true;
dns_timeout = 5;
+ MaxTargets = 20;
NetBufferSize = 10240;
SoftLimit = MAXCLIENTS;
MaxConn = SOMAXCONN;
@@ -146,7 +147,7 @@ bool ServerConfig::CheckOnce(char* tag, bool bail, userrec* user)
void ServerConfig::Read(bool bail, userrec* user)
{
- char dbg[MAXBUF],pauseval[MAXBUF],Value[MAXBUF],timeout[MAXBUF],NB[MAXBUF],flood[MAXBUF],MW[MAXBUF],MCON[MAXBUF];
+ char dbg[MAXBUF],pauseval[MAXBUF],Value[MAXBUF],timeout[MAXBUF],NB[MAXBUF],flood[MAXBUF],MW[MAXBUF],MCON[MAXBUF],MT[MAXBUF];
char AH[MAXBUF],AP[MAXBUF],AF[MAXBUF],DNT[MAXBUF],pfreq[MAXBUF],thold[MAXBUF],sqmax[MAXBUF],rqmax[MAXBUF],SLIMT[MAXBUF];
ConnectClass c;
std::stringstream errstr;
@@ -222,8 +223,16 @@ void ServerConfig::Read(bool bail, userrec* user)
ConfValue("options","softlimit",0,SLIMT,&Config->config_f);
ConfValue("options","operonlystats",0,Config->OperOnlyStats,&Config->config_f);
ConfValue("options","customversion",0,Config->CustomVersion,&Config->config_f);
+ ConfValue("options","maxtargets",0,MT,&Config->config_f);
Config->SoftLimit = atoi(SLIMT);
+ if (*MT)
+ Config->MaxTargets = atoi(MT);
+ if (Config->MaxTargets < 0) || (Config->MaxTargets > 31)
+ {
+ log(DEFAULT,"WARNING: <options:maxtargets> value is greater than 31 or less than 0, set to 20.");
+ Config->MaxTargets = 20;
+ }
if ((Config->SoftLimit < 1) || (Config->SoftLimit > MAXCLIENTS))
{
log(DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS);