summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/example_new.conf7
-rw-r--r--src/config.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/data/example_new.conf b/data/example_new.conf
index d9a0cd52e..05ac2cc16 100644
--- a/data/example_new.conf
+++ b/data/example_new.conf
@@ -800,4 +800,11 @@ operserv
* This directive is optional.
*/
limitsessions = yes
+
+ /*
+ * Default session limit per host. Once a host reaches it's session limit, all clients attempting
+ * to connect from that host will be killed. A value of zero means an unlimited session limit.
+ * If not given and session limiting is enabled, it will default to no limit.
+ */
+ defaultsessionlimit = 3
}
diff --git a/src/config.c b/src/config.c
index 423d504ab..146a6a58e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -659,6 +659,7 @@ int ServerConfig::Read(bool bail)
{"operserv", "disableraw", "no", new ValueContainerBool(&DisableRaw), DT_BOOLEAN, NoValidation},
{"operserv", "notifications", "", new ValueContainerString(&OSNotifications), DT_STRING, NoValidation},
{"operserv", "limitsessions", "no", new ValueContainerBool(&LimitSessions), DT_BOOLEAN, NoValidation},
+ {"operserv", "defaultsessionlimit", "0", new ValueContainerInt(&DefSessionLimit), DT_INTEGER, NoValidation},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1236,7 +1237,6 @@ Directive directives[] = {
{"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}},
{"BotCoreModules", {{PARAM_STRING, PARAM_RELOAD, &BotCoreModules}}},
{"ChanCoreModules", {{PARAM_STRING, PARAM_RELOAD, &ChanCoreModules}}},
- {"DefSessionLimit", {{PARAM_POSINT, 0, &DefSessionLimit}}},
{"DontQuoteAddresses",
{{PARAM_SET, PARAM_RELOAD, &DontQuoteAddresses}}},
{"DumpCore", {{PARAM_SET, 0, &DumpCore}}},
@@ -1881,7 +1881,6 @@ int read_config(int reload)
if (LimitSessions) {
- CHECK(DefSessionLimit);
CHECK(MaxSessionLimit);
CHECK(ExceptionExpiry);