diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-11 10:03:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-11 10:03:09 +0000 |
commit | 276b84df68ce8655947f2870d835cac4eecf6a98 (patch) | |
tree | bdabbed25979b127cc1be7f151ad7a6fb84c00c2 /src/socket.cpp | |
parent | e82f44b3edd095122b6dde8e171cf1a21a12671e (diff) |
Move openSockfd[] into ServerConfig
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4322 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index a6847fce1..793e930ff 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -26,7 +26,6 @@ extern InspIRCd* ServerInstance; extern ServerConfig* Config; extern time_t TIME; -extern int openSockfd[MAX_DESCRIPTORS]; /** This will bind a socket to a port. It works for UDP/TCP. * If a hostname is given to bind to, the function will first @@ -165,21 +164,21 @@ int BindPorts(bool bail) { for (int count = InitialPortCount; count < InitialPortCount + PortCount; count++) { - if ((openSockfd[count] = OpenTCPSocket()) == ERROR) + if ((Config->openSockfd[count] = OpenTCPSocket()) == ERROR) { - log(DEBUG,"Bad fd %d binding port [%s:%d]",openSockfd[count],Config->addrs[count],Config->ports[count]); + log(DEBUG,"Bad fd %d binding port [%s:%d]",Config->openSockfd[count],Config->addrs[count],Config->ports[count]); return ERROR; } - if (!BindSocket(openSockfd[count],client,server,Config->ports[count],Config->addrs[count])) + if (!BindSocket(Config->openSockfd[count],client,server,Config->ports[count],Config->addrs[count])) { log(DEFAULT,"Failed to bind port [%s:%d]: %s",Config->addrs[count],Config->ports[count],strerror(errno)); } else { /* Associate the new open port with a slot in the socket engine */ - if (openSockfd[count] > -1) + if (Config->openSockfd[count] > -1) { - ServerInstance->SE->AddFd(openSockfd[count],true,X_LISTEN); + ServerInstance->SE->AddFd(Config->openSockfd[count],true,X_LISTEN); BoundPortCount++; } } @@ -221,13 +220,13 @@ int BindPorts(bool bail) for (int count = 0; count < PortCount; count++) { - if ((openSockfd[BoundPortCount] = OpenTCPSocket()) == ERROR) + if ((Config->openSockfd[BoundPortCount] = OpenTCPSocket()) == ERROR) { - log(DEBUG,"Bad fd %d binding port [%s:%d]",openSockfd[BoundPortCount],Config->addrs[count],Config->ports[count]); + log(DEBUG,"Bad fd %d binding port [%s:%d]",Config->openSockfd[BoundPortCount],Config->addrs[count],Config->ports[count]); return ERROR; } - if (!BindSocket(openSockfd[BoundPortCount],client,server,Config->ports[count],Config->addrs[count])) + if (!BindSocket(Config->openSockfd[BoundPortCount],client,server,Config->ports[count],Config->addrs[count])) { log(DEFAULT,"Failed to bind port [%s:%d]: %s",Config->addrs[count],Config->ports[count],strerror(errno)); } |