diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 23:37:37 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-09 23:37:37 +0000 |
commit | cf2cb67bccacf8cc226f4b95c0ae7a1b1fb27541 (patch) | |
tree | 43a12f14feac2bbfd95486c9d7755a3191f9aa09 /src/inspircd_io.cpp | |
parent | 9324196112e391b0da6e8e01a6592f5966d44c08 (diff) |
More stuff done
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3611 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r-- | src/inspircd_io.cpp | 25 |
1 files 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: <server:name> '%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: <options:somaxconn> 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: <server:name> '%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; |