diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-22 23:54:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-22 23:54:04 +0000 |
commit | 8486ec92d22dcee8e2d02f0d76ddb8ade08aa9a7 (patch) | |
tree | 175760ec4e7ad8dd61a4866cec1fa2d6204b0729 /src/inspircd_io.cpp | |
parent | 8bf2b150d625788f8dcb0ce0897537b832272760 (diff) |
Allowed for configuration of maxtargets in <options:maxtargets>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2848 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r-- | src/inspircd_io.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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); |