diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-30 17:37:13 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-30 17:37:13 +0000 |
commit | 2779810ff0d1b66f0fca1a62d6164d70f5c86d06 (patch) | |
tree | 101caa8c28e64e6580d6674eb93e8d349673df21 /src/socket.cpp | |
parent | c9235e50f471e5071c0601dde62bb741d9b6f05c (diff) |
Apply ipv6 #ifdef tidyup patch from djGrrr, thanks :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7190 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 132846b3c..68b93a4b4 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -47,10 +47,8 @@ ListenSocket::ListenSocket(InspIRCd* Instance, int port, char* addr) : ServerIns if ((!*addr) || (strchr(addr,':'))) this->family = AF_INET6; else - this->family = AF_INET; -#else - this->family = AF_INET; #endif + this->family = AF_INET; Instance->SE->AddFd(this); } } @@ -80,14 +78,11 @@ void ListenSocket::HandleEvent(EventType et, int errornum) length = sizeof(sockaddr_in6); } else +#endif { uslen = sizeof(sockaddr_in); length = sizeof(sockaddr_in); } -#else - uslen = sizeof(sockaddr_in); - length = sizeof(sockaddr_in); -#endif /* * This loop may make you wonder 'why' - simple reason. If we just sit here accept()ing until the @@ -112,14 +107,12 @@ void ListenSocket::HandleEvent(EventType et, int errornum) in_port = ntohs(((sockaddr_in6*)sock_us)->sin6_port); } else +#endif { inet_ntop(AF_INET, &((const sockaddr_in*)client)->sin_addr, buf, sizeof(buf)); in_port = ntohs(((sockaddr_in*)sock_us)->sin_port); } -#else - inet_ntop(AF_INET, &((const sockaddr_in*)client)->sin_addr, buf, sizeof(buf)); - in_port = ntohs(((sockaddr_in*)sock_us)->sin_port); -#endif + NonBlocking(incomingSockfd); if (ServerInstance->Config->GetIOHook(in_port)) { |