summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connection.cpp24
-rw-r--r--src/inspircd.cpp4
2 files changed, 14 insertions, 14 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 61c3c5bfe..bb3e8f75b 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -42,6 +42,18 @@ bool connection::CreateListener(char* host, int p)
return false;
}
+ setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on));
+ linger.l_onoff = 1;
+ linger.l_linger = 0;
+ setsockopt(fd,SOL_SOCKET,SO_LINGER,(const char*)&linger,sizeof(linger));
+
+ // attempt to increase socket sendq and recvq as high as its possible
+ // to get them on linux.
+ int sendbuf = 32768;
+ int recvbuf = 32768;
+ setsockopt(fd,SOL_SOCKET,SO_SNDBUF,(const void *)&sendbuf,sizeof(sendbuf));
+ setsockopt(fd,SOL_SOCKET,SO_RCVBUF,(const void *)&recvbuf,sizeof(sendbuf));
+
memset((void*)&host_address, 0, sizeof(host_address));
host_address.sin_family = AF_INET;
@@ -69,18 +81,6 @@ bool connection::CreateListener(char* host, int p)
this->port = p;
- setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on));
- linger.l_onoff = 1;
- linger.l_linger = 0;
- setsockopt(fd,SOL_SOCKET,SO_LINGER,(const char*)&linger,sizeof(linger));
-
- // attempt to increase socket sendq and recvq as high as its possible
- // to get them on linux.
- int sendbuf = 32768;
- int recvbuf = 32768;
- setsockopt(fd,SOL_SOCKET,SO_SNDBUF,(const void *)&sendbuf,sizeof(sendbuf));
- setsockopt(fd,SOL_SOCKET,SO_RCVBUF,(const void *)&recvbuf,sizeof(sendbuf));
-
listen(this->fd,5);
return true;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 48460b369..a71cf08ab 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -3127,11 +3127,11 @@ int reap_counter = 0;
int InspIRCd(void)
{
- struct sockaddr_in client, server;
+ struct sockaddr_in client,server;
char addrs[MAXBUF][255];
int openSockfd[MAXSOCKS], incomingSockfd, result = TRUE;
socklen_t length;
- int count = 0, scanDetectTrigger = TRUE, showBanner = FALSE;
+ int count = 0;
int selectResult = 0, selectResult2 = 0;
char *temp, configToken[MAXBUF], stuff[MAXBUF], Addr[MAXBUF], Type[MAXBUF];
char resolvedHost[MAXBUF];