summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp10
-rw-r--r--src/usermanager.cpp5
2 files changed, 7 insertions, 8 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 35c65fede..2c5d01ee1 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -47,7 +47,7 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
dns_timeout = DieDelay = 5;
MaxTargets = 20;
NetBufferSize = 10240;
- SoftLimit = MAXCLIENTS;
+ SoftLimit = Instance->SE->GetMaxFds();
MaxConn = SOMAXCONN;
MaxWhoResults = 0;
debugging = 0;
@@ -261,10 +261,10 @@ bool ValidateMaxTargets(ServerConfig* conf, const char*, const char*, ValueItem
bool ValidateSoftLimit(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- if ((data.GetInteger() < 1) || (data.GetInteger() > MAXCLIENTS))
+ if ((data.GetInteger() < 1) || (data.GetInteger() > conf->GetInstance()->SE->GetMaxFds()))
{
- conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS);
- data.Set(MAXCLIENTS);
+ conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",conf->GetInstance()->SE->GetMaxFds(),conf->GetInstance()->SE->GetMaxFds());
+ data.Set(conf->GetInstance()->SE->GetMaxFds());
}
return true;
}
@@ -767,7 +767,7 @@ void ServerConfig::Read(bool bail, User* user)
/* These tags can occur ONCE or not at all */
InitialConfig Values[] = {
- {"options", "softlimit", MAXCLIENTS_S, new ValueContainerUInt (&this->SoftLimit), DT_INTEGER, ValidateSoftLimit},
+ {"options", "softlimit", "0", new ValueContainerUInt (&this->SoftLimit), DT_INTEGER, ValidateSoftLimit},
{"options", "somaxconn", SOMAXCONN_S, new ValueContainerInt (&this->MaxConn), DT_INTEGER, ValidateMaxConn},
{"options", "moronbanner", "Youre banned!", new ValueContainerChar (this->MoronBanner), DT_CHARPTR, NoValidation},
{"server", "name", "", new ValueContainerChar (this->ServerName), DT_HOSTNAME|DT_BOOTONLY, ValidateServerName},
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 6a23ad795..59ac3fce9 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -108,7 +108,7 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
this->local_users.push_back(New);
- if ((this->local_users.size() > Instance->Config->SoftLimit) || (this->local_users.size() >= MAXCLIENTS))
+ if ((this->local_users.size() > Instance->Config->SoftLimit) || (this->local_users.size() >= Instance->SE->GetMaxFds()))
{
Instance->SNO->WriteToSnoMask('A', "Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit);
User::QuitUser(Instance, New,"No more connections allowed");
@@ -125,13 +125,12 @@ void UserManager::AddClient(InspIRCd* Instance, int socket, int port, bool iscac
* which for the time being is a physical impossibility (even the largest networks dont have more
* than about 10,000 users on ONE server!)
*/
-#ifndef WINDOWS
if (socket >= Instance->SE->GetMaxFds())
{
User::QuitUser(Instance, New, "Server is full");
return;
}
-#endif
+
/*
* even with bancache, we still have to keep User::exempt current.
* besides that, if we get a positive bancache hit, we still won't fuck