From 8486ec92d22dcee8e2d02f0d76ddb8ade08aa9a7 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 22 Jan 2006 23:54:04 +0000 Subject: Allowed for configuration of maxtargets in git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2848 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 2 +- src/inspircd_io.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') 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: 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: value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS); -- cgit v1.2.3