From f9636a2eff46f6829bf9e01c711ab1ba45a7d50a Mon Sep 17 00:00:00 2001
From: brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Date: Thu, 10 Aug 2006 22:40:57 +0000
Subject: So much stuff changed in this one, i forgot most of it. Oh yeah, main
 thing is ModeHandler and ModeWatcher classes now take an InspIRCd* to their
 constructor

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4858 e03df62e-2008-0410-955e-edbf42e46eb7
---
 src/socket.cpp | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

(limited to 'src/socket.cpp')

diff --git a/src/socket.cpp b/src/socket.cpp
index e0d02a48a..4de038ef1 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -227,7 +227,7 @@ inline void irc::sockets::NonBlocking(int s)
  * It can only bind to IP addresses, if you wish to bind to hostnames
  * you should first resolve them using class 'Resolver'.
  */ 
-bool irc::sockets::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr)
+bool InspIRCd::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr server, int port, char* addr)
 {
 	memset(&server,0,sizeof(server));
 	insp_inaddr addy;
@@ -274,7 +274,7 @@ bool irc::sockets::BindSocket(int sockfd, insp_sockaddr client, insp_sockaddr se
 	else
 	{
 		log(DEBUG,"Bound port %s:%d",*addr ? addr : "*",port);
-		if (listen(sockfd, ServerInstance->Config->MaxConn) == -1)
+		if (listen(sockfd, Config->MaxConn) == -1)
 		{
 			log(DEFAULT,"ERROR in listen(): %s",strerror(errno));
 			return false;
@@ -312,10 +312,9 @@ int irc::sockets::OpenTCPSocket()
 }
 
 /* XXX: Probably belongs in class InspIRCd */
-bool HasPort(int port, char* addr)
+bool InspIRCd::HasPort(int port, char* addr)
 {
-	ServerConfig* Config = ServerInstance->Config;
-	for (unsigned long count = 0; count < ServerInstance->stats->BoundPortCount; count++)
+	for (unsigned long count = 0; count < stats->BoundPortCount; count++)
 	{
 		if ((port == Config->ports[count]) && (!strcasecmp(Config->addrs[count],addr)))
 		{
@@ -326,17 +325,16 @@ bool HasPort(int port, char* addr)
 }
 
 /* XXX: Probably belongs in class InspIRCd */
-int irc::sockets::BindPorts(bool bail)
+int InspIRCd::BindPorts(bool bail)
 {
 	char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF];
 	insp_sockaddr client, server;
 	int clientportcount = 0;
 	int BoundPortCount = 0;
-	ServerConfig* Config = ServerInstance->Config;
 
 	if (!bail)
 	{
-		int InitialPortCount = ServerInstance->stats->BoundPortCount;
+		int InitialPortCount = stats->BoundPortCount;
 		log(DEBUG,"Initial port count: %d",InitialPortCount);
 
 		for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++)
@@ -377,7 +375,7 @@ int irc::sockets::BindPorts(bool bail)
 						/* Associate the new open port with a slot in the socket engine */
 						if (Config->openSockfd[count] > -1)
 						{
-							if (!ServerInstance->SE->AddFd(Config->openSockfd[count],true,X_LISTEN))
+							if (!SE->AddFd(Config->openSockfd[count],true,X_LISTEN))
 							{
 								log(DEFAULT,"ERK! Failed to add listening port to socket engine!");
 								shutdown(Config->openSockfd[count],2);
-- 
cgit v1.2.3