From cf2cb67bccacf8cc226f4b95c0ae7a1b1fb27541 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 9 Mar 2006 23:37:37 +0000 Subject: [PATCH] More stuff done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3611 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd_io.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 9bd6ce522..a1ed104a2 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -167,6 +167,17 @@ bool NoValidation(const char* tag, const char* value, void* data) return true; } +bool ValidateServerName(const char* tag, const char* value, void* data) +{ + char* x = (char*)data; + if (!strchr(x,'.')) + { + log(DEFAULT,"WARNING: '%s' is not a fully-qualified domain name. Changed to '%s%c'",x,x,'.'); + charlcat(x,'.',MAXBUF); + } + return true; +} + void ServerConfig::Read(bool bail, userrec* user) { char debug[MAXBUF]; @@ -174,7 +185,7 @@ void ServerConfig::Read(bool bail, userrec* user) static InitialConfig Values[] = { {"options", "softlimit", &this->SoftLimit, DT_INTEGER, NoValidation}, {"options", "somaxconn", &this->MaxConn, DT_INTEGER, NoValidation}, - {"server", "name", &this->ServerName, DT_CHARPTR, NoValidation}, + {"server", "name", &this->ServerName, DT_CHARPTR, ValidateServerName}, {"server", "description", &this->ServerDesc, DT_CHARPTR, NoValidation}, {"server", "network", &this->Network, DT_CHARPTR, NoValidation}, {"admin", "name", &this->AdminName, DT_CHARPTR, NoValidation}, @@ -308,21 +319,9 @@ void ServerConfig::Read(bool bail, userrec* user) Config->SoftLimit = MAXCLIENTS; } - Config->MaxConn = atoi(MCON); - if (Config->MaxConn > SOMAXCONN) log(DEFAULT,"WARNING: value may be higher than the system-defined SOMAXCONN value!"); - Config->NetBufferSize = atoi(NB); - Config->MaxWhoResults = atoi(MW); - Config->dns_timeout = atoi(DNT); - - if (!strchr(Config->ServerName,'.')) - { - log(DEFAULT,"WARNING: '%s' is not a fully-qualified domain name. Changed to '%s%c'",Config->ServerName,Config->ServerName,'.'); - charlcat(Config->ServerName,'.',MAXBUF); - } - if (!Config->dns_timeout) Config->dns_timeout = 5; -- 2.39.2