mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
Remove duplicate default-value code.
Default values for default_floodcount and default_ident_timeout are set in s_conf.c. Remove code that checks for missing values in ircd.c. Additionally, reset default_ident_timeout to 5 if an invalid value (i.e. 0) is provided.
This commit is contained in:
parent
e5c254d7d1
commit
7f3382fe98
3 changed files with 7 additions and 10 deletions
|
@ -55,7 +55,7 @@
|
|||
#define CLIENT_FLOOD_MIN 10
|
||||
#define LINKS_DELAY_DEFAULT 300
|
||||
#define MAX_TARGETS_DEFAULT 4 /* default for max_targets */
|
||||
#define IDENT_TIMEOUT 10
|
||||
#define IDENT_TIMEOUT_DEFAULT 5
|
||||
#define MIN_JOIN_LEAVE_TIME 60
|
||||
#define MAX_JOIN_LEAVE_COUNT 25
|
||||
#define OPER_SPAM_COUNTDOWN 5
|
||||
|
|
10
src/ircd.c
10
src/ircd.c
|
@ -309,10 +309,7 @@ initialize_global_set_options(void)
|
|||
GlobalSetOptions.spam_time = MIN_JOIN_LEAVE_TIME;
|
||||
GlobalSetOptions.spam_num = MAX_JOIN_LEAVE_COUNT;
|
||||
|
||||
if(ConfigFileEntry.default_floodcount)
|
||||
GlobalSetOptions.floodcount = ConfigFileEntry.default_floodcount;
|
||||
else
|
||||
GlobalSetOptions.floodcount = 10;
|
||||
GlobalSetOptions.floodcount = ConfigFileEntry.default_floodcount;
|
||||
|
||||
split_servers = ConfigChannel.default_split_server_count;
|
||||
split_users = ConfigChannel.default_split_user_count;
|
||||
|
@ -324,10 +321,7 @@ initialize_global_set_options(void)
|
|||
splitchecking = 1;
|
||||
}
|
||||
|
||||
if(ConfigFileEntry.default_ident_timeout)
|
||||
GlobalSetOptions.ident_timeout = ConfigFileEntry.default_ident_timeout;
|
||||
else
|
||||
GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
|
||||
GlobalSetOptions.ident_timeout = ConfigFileEntry.default_ident_timeout;
|
||||
|
||||
rb_strlcpy(GlobalSetOptions.operstring,
|
||||
ConfigFileEntry.default_operstring,
|
||||
|
|
|
@ -789,7 +789,7 @@ set_default_conf(void)
|
|||
ConfigFileEntry.min_nonwildcard = 4;
|
||||
ConfigFileEntry.min_nonwildcard_simple = 3;
|
||||
ConfigFileEntry.default_floodcount = 8;
|
||||
ConfigFileEntry.default_ident_timeout = 5;
|
||||
ConfigFileEntry.default_ident_timeout = IDENT_TIMEOUT_DEFAULT;
|
||||
ConfigFileEntry.tkline_expire_notices = 0;
|
||||
|
||||
ConfigFileEntry.reject_after_count = 5;
|
||||
|
@ -840,6 +840,9 @@ read_conf(FILE * file)
|
|||
static void
|
||||
validate_conf(void)
|
||||
{
|
||||
if(ConfigFileEntry.default_ident_timeout < 1)
|
||||
ConfigFileEntry.default_ident_timeout = IDENT_TIMEOUT_DEFAULT;
|
||||
|
||||
if(ConfigFileEntry.ts_warn_delta < TS_WARN_DELTA_MIN)
|
||||
ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT;
|
||||
|
||||
|
|
Loading…
Reference in a new issue