]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Fix for parameters which contain a colon (which is not the first char in the string)
[user/henk/code/inspircd.git] / src / socket.cpp
index 50a4050e01f6d0acbaf5a36d3542e33440d00d5c..eaa8e0d8cb0e164735972728dbab507548f7408d 100644 (file)
@@ -18,7 +18,6 @@
 #include "configreader.h"
 #include "socket.h"
 #include "inspircd.h"
-#include "inspstring.h"
 #include "socketengine.h"
 #include "wildcard.h"
 
@@ -422,6 +421,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 +431,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 +494,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++;
                        }