summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-18 19:15:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-18 19:15:45 +0000
commited3adc710cc7131b3434949e4675a657ed2e3840 (patch)
tree76d58e6c6bf3f1b787de8e5d3fb1d6908b14f5d8 /src/socket.cpp
parent39a3660ebd2812f618f072d726ba356114f914b1 (diff)
Fix trying to add failed ports to socketengine (<3 new code)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4967 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 50a4050e0..2dc8f017d 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -422,6 +422,7 @@ int InspIRCd::BindPorts(bool bail)
int PortCount = clientportcount;
if (PortCount)
{
+ BoundPortCount = stats->BoundPortCount;
for (int count = InitialPortCount; count < InitialPortCount + PortCount; count++)
{
int fd = OpenTCPSocket();
@@ -431,15 +432,15 @@ int InspIRCd::BindPorts(bool bail)
}
else
{
- Config->openSockfd[count] = new ListenSocket(this,fd,client,server,Config->ports[count],Config->addrs[count]);
- if (Config->openSockfd[count]->GetFd() > -1)
+ Config->openSockfd[BoundPortCount] = new ListenSocket(this,fd,client,server,Config->ports[count],Config->addrs[count]);
+ if (Config->openSockfd[BoundPortCount]->GetFd() > -1)
{
- if (!SE->AddFd(Config->openSockfd[count]))
+ if (!SE->AddFd(Config->openSockfd[BoundPortCount]))
{
this->Log(DEFAULT,"ERK! Failed to add listening port to socket engine!");
- shutdown(Config->openSockfd[count]->GetFd(),2);
- close(Config->openSockfd[count]->GetFd());
- delete Config->openSockfd[count];
+ shutdown(Config->openSockfd[BoundPortCount]->GetFd(),2);
+ close(Config->openSockfd[BoundPortCount]->GetFd());
+ delete Config->openSockfd[BoundPortCount];
}
else
BoundPortCount++;
@@ -494,8 +495,8 @@ int InspIRCd::BindPorts(bool bail)
}
else
{
- Config->openSockfd[count] = new ListenSocket(this,fd,client,server,Config->ports[count],Config->addrs[count]);
- if (Config->openSockfd[count]->GetFd() > -1)
+ Config->openSockfd[BoundPortCount] = new ListenSocket(this,fd,client,server,Config->ports[count],Config->addrs[count]);
+ if (Config->openSockfd[BoundPortCount]->GetFd() > -1)
{
BoundPortCount++;
}