From 7107ec12d8640d35cfe3d5002db1bc1deb33625d Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 26 Sep 2009 16:41:07 +0000 Subject: Flexible SendQ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11766 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 3fb60034d..21bfce3db 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -338,8 +338,8 @@ static bool ValidateMaxWho(ServerConfig* conf, const char*, const char*, ValueIt { if ((data.GetInteger() > 65535) || (data.GetInteger() < 1)) { - ServerInstance->Logs->Log("CONFIG",DEFAULT," size out of range, setting to default of 128."); - data.Set(128); + ServerInstance->Logs->Log("CONFIG",DEFAULT," size out of range, setting to default of 1024."); + data.Set(1024); } return true; } @@ -688,7 +688,19 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current) if (ConfValue("connect", "pingfreq", i, tmpv, false)) me->pingtime = atol(tmpv.c_str()); if (ConfValue("connect", "sendq", i, tmpv, false)) - me->sendqmax = atol(tmpv.c_str()); + { + // attempt to guess a good hard/soft sendq from a single value + long value = atol(tmpv.c_str()); + if (value > 16384) + me->softsendqmax = value / 16; + else + me->softsendqmax = value; + me->hardsendqmax = value * 8; + } + if (ConfValue("connect", "softsendq", i, tmpv, false)) + me->softsendqmax = atol(tmpv.c_str()); + if (ConfValue("connect", "hardsendq", i, tmpv, false)) + me->hardsendqmax = atol(tmpv.c_str()); if (ConfValue("connect", "recvq", i, tmpv, false)) me->recvqmax = atol(tmpv.c_str()); if (ConfValue("connect", "localmax", i, tmpv, false)) @@ -770,7 +782,7 @@ static const InitialConfig Values[] = { {"options", "suffixpart", "", new ValueContainerChar (&ServerConfig::SuffixPart), DT_CHARPTR, NULL}, {"options", "fixedpart", "", new ValueContainerChar (&ServerConfig::FixedPart), DT_CHARPTR, NULL}, {"performance", "netbuffersize","10240", new ValueContainerInt (&ServerConfig::NetBufferSize), DT_INTEGER, ValidateNetBufferSize}, - {"performance", "maxwho", "128", new ValueContainerInt (&ServerConfig::MaxWhoResults), DT_INTEGER, ValidateMaxWho}, + {"performance", "maxwho", "1024", new ValueContainerInt (&ServerConfig::MaxWhoResults), DT_INTEGER, ValidateMaxWho}, {"options", "allowhalfop", "0", new ValueContainerBool (&ServerConfig::AllowHalfop), DT_BOOLEAN, ValidateHalfOp}, {"dns", "server", "", new ValueContainerChar (&ServerConfig::DNSServer), DT_IPADDRESS,ValidateDnsServer}, {"dns", "timeout", "5", new ValueContainerInt (&ServerConfig::dns_timeout), DT_INTEGER, NULL}, -- cgit v1.2.3