]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
More stuff done
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 9 Mar 2006 23:37:37 +0000 (23:37 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 9 Mar 2006 23:37:37 +0000 (23:37 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3611 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd_io.cpp

index 9bd6ce522b467cc91d09e8ae70847065bd9761e1..a1ed104a25acd6e617d0004aa578fc438c706412 100644 (file)
@@ -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;