aboutsummaryrefslogtreecommitdiffstats
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-11-24 20:11:46 +0000
committerGravatar Sadie Powell2021-11-24 20:28:05 +0000
commit460220fbf53c061f4bfd8c71bad7430170f23d7f (patch)
treed3496b0bad0bbfe0b0d5eeb0854451109c21866c /src/configreader.cpp
parentFix ConnectClass inheriting from refcountbase. (diff)
Add sensible defaults and limits to ConnectClass.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 86329355e..579cfaff6 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -262,17 +262,17 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
me->softsendqmax = value;
me->hardsendqmax = value * 8;
}
- me->softsendqmax = tag->getUInt("softsendq", me->softsendqmax);
- me->hardsendqmax = tag->getUInt("hardsendq", me->hardsendqmax);
- me->recvqmax = tag->getUInt("recvq", me->recvqmax);
- me->penaltythreshold = tag->getUInt("threshold", me->penaltythreshold);
- me->commandrate = tag->getUInt("commandrate", me->commandrate);
+ me->softsendqmax = tag->getUInt("softsendq", me->softsendqmax, ServerInstance->Config->Limits.MaxLine);
+ me->hardsendqmax = tag->getUInt("hardsendq", me->hardsendqmax, ServerInstance->Config->Limits.MaxLine);
+ me->recvqmax = tag->getUInt("recvq", me->recvqmax, ServerInstance->Config->Limits.MaxLine);
+ me->penaltythreshold = tag->getUInt("threshold", me->penaltythreshold, 1);
+ me->commandrate = tag->getUInt("commandrate", me->commandrate, 1);
me->fakelag = tag->getBool("fakelag", me->fakelag);
- me->maxlocal = tag->getUInt("localmax", me->maxlocal);
- me->maxglobal = tag->getUInt("globalmax", me->maxglobal);
+ me->maxlocal = tag->getUInt("localmax", me->maxlocal, 1);
+ me->maxglobal = tag->getUInt("globalmax", me->maxglobal, 1);
me->maxchans = tag->getUInt("maxchans", me->maxchans);
me->maxconnwarn = tag->getBool("maxconnwarn", me->maxconnwarn);
- me->limit = tag->getUInt("limit", me->limit);
+ me->limit = tag->getUInt("limit", me->limit, 1);
me->resolvehostnames = tag->getBool("resolvehostnames", me->resolvehostnames);
me->uniqueusername = tag->getBool("uniqueusername", me->uniqueusername);
me->password = tag->getString("password", me->password);