From 665d01855ea1b54e48c0acdf9db44a8dbf0f3dc6 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 14 Dec 2005 18:00:59 +0000 Subject: Fixed to use MAXSOCKS git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2431 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspircd_io.h | 4 ++++ src/inspircd.cpp | 1 - src/inspircd_io.cpp | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/inspircd_io.h b/include/inspircd_io.h index 58c018c25..f07666747 100644 --- a/include/inspircd_io.h +++ b/include/inspircd_io.h @@ -246,6 +246,10 @@ class ServerConfig : public classbase */ std::vector module_names; + /** A list of ports which the server is listening on + */ + int ports[MAXSOCKS]; + ServerConfig(); /** Clears the include stack in preperation for diff --git a/src/inspircd.cpp b/src/inspircd.cpp index cb2360c41..cc4964ca8 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -99,7 +99,6 @@ command_table cmdlist; address_cache IP; servernamelist servernames; int boundPortCount = 0; -int portCount = 0, ports[MAXSOCKS]; std::vector all_opers; char lowermap[255]; diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 631cf397a..2b5a880cb 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -1037,7 +1037,7 @@ int BindPorts() { // modules handle server bind types now, // its not a typo in the strcmp. - ports[clientportcount] = atoi(configToken); + Config->ports[clientportcount] = atoi(configToken); strlcpy(Config->addrs[clientportcount],Addr,256); clientportcount++; log(DEBUG,"InspIRCd: startup: read binding %s:%s [%s] from config",Addr,configToken, Type); @@ -1052,9 +1052,9 @@ int BindPorts() log(DEBUG,"InspIRCd: startup: bad fd %lu",(unsigned long)openSockfd[boundPortCount]); return(ERROR); } - if (BindSocket(openSockfd[boundPortCount],client,server,ports[count],Config->addrs[count]) == ERROR) + if (BindSocket(openSockfd[boundPortCount],client,server,Config->ports[count],Config->addrs[count]) == ERROR) { - log(DEFAULT,"InspIRCd: startup: failed to bind port %lu",(unsigned long)ports[count]); + log(DEFAULT,"InspIRCd: startup: failed to bind port %lu",(unsigned long)Config->ports[count]); } else /* well we at least bound to one socket so we'll continue */ { -- cgit v1.2.3