summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/example_new.conf22
-rw-r--r--include/extern.h2
-rw-r--r--src/config.c6
3 files changed, 25 insertions, 5 deletions
diff --git a/data/example_new.conf b/data/example_new.conf
index 7eba325ee..b48963524 100644
--- a/data/example_new.conf
+++ b/data/example_new.conf
@@ -319,6 +319,28 @@ options {
* WALLOPS/GLOBOPS.
*/
warningtimeout = 4h
+
+ /*
+ * Sets the (maximum) frequency at which the timeout list is checked. This,
+ * combined with readtimeout above, determine how accurately timed events,
+ * such as nick kills, occur; it also determines how much CPU time Services
+ * will use doing this. Higher values will cause less accurate timing but
+ * less CPU usage.
+ *
+ * This shouldn't be set any higher than 10 seconds, and 1 second is best
+ * if your system is powerful enough (or your network small enough) to
+ * handle it. 0 will cause the timeout list to be checked every time
+ * through the main loop, which will probably slow down Services too much
+ * to be useful on most networks.
+ *
+ * Note that this value is not an absolute limit on the period between
+ * checks of the timeout list; the previous may be as great as readtimeout
+ * (above) during periods of inactivity.
+ *
+ * If this directive is not given, it will default to 0. See the 2nd paragraph
+ * above for performance impacts if you do this.
+ */
+ timeoutcheck = 3s
}
/*
diff --git a/include/extern.h b/include/extern.h
index ce6dbb15e..9077983e6 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -291,7 +291,7 @@ E time_t UpdateTimeout;
E time_t ExpireTimeout;
E time_t ReadTimeout;
E time_t WarningTimeout;
-E int TimeoutCheck;
+E time_t TimeoutCheck;
E int KeepLogs;
E int KeepBackups;
E int ForceForbidReason;
diff --git a/src/config.c b/src/config.c
index ad58682b2..0d1cb84b9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -93,7 +93,7 @@ time_t UpdateTimeout;
time_t ExpireTimeout;
time_t ReadTimeout;
time_t WarningTimeout;
-int TimeoutCheck;
+time_t TimeoutCheck;
int KeepLogs;
int KeepBackups;
int ForceForbidReason;
@@ -646,6 +646,7 @@ int ServerConfig::Read(bool bail)
{"options", "expiretimeout", "0", new ValueContainerTime(&ExpireTimeout), DT_TIME, ValidateNotZero},
{"options", "readtimeout", "0", new ValueContainerTime(&ReadTimeout), DT_TIME, ValidateNotZero},
{"options", "warningtimeout", "0", new ValueContainerTime(&WarningTimeout), DT_TIME, ValidateNotZero},
+ {"options", "timeoutcheck", "0", new ValueContainerTime(&TimeoutCheck), DT_TIME, NoValidation},
{"nickserv", "nick", "NickServ", new ValueContainerChar(&s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "database", "nick.db", new ValueContainerChar(&NickDBName), DT_CHARPTR, ValidateNotEmpty},
@@ -1389,7 +1390,6 @@ Directive directives[] = {
{"GlobalOnCycleMessage",
{{PARAM_STRING, PARAM_RELOAD, &GlobalOnCycleMessage}}},
{"GlobalOnCycleUP", {{PARAM_STRING, PARAM_RELOAD, &GlobalOnCycleUP}}},
- {"TimeoutCheck", {{PARAM_TIME, PARAM_RELOAD, &TimeoutCheck}}},
{"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}},
{"UseStrictPrivMsg", {{PARAM_SET, PARAM_RELOAD, &UseStrictPrivMsg}}},
{"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}},
@@ -1701,8 +1701,6 @@ int read_config(int reload)
}
}
- CHECK(TimeoutCheck);
-
if (temp_nsuserhost) {
if (!(s = strchr(temp_nsuserhost, '@'))) {
NSEnforcerUser = temp_nsuserhost;