X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsocket.cpp;h=d5ad7b4ce6cd5e4a68e3440343ea81c058de47a2;hb=6f4bf8ffd367f35b96265fea1ad01fb1acf2adcd;hp=b68de7159764198b90325539934ea8f80883625d;hpb=69c3a32784b8c638ea10c269c3f63ede86b8aaa0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/socket.cpp b/src/socket.cpp index b68de7159..d5ad7b4ce 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -389,7 +389,7 @@ bool InspIRCd::HasPort(int port, char* addr) } /* XXX: Probably belongs in class InspIRCd */ -int InspIRCd::BindPorts(bool bail, int &ports_found) +int InspIRCd::BindPorts(bool bail, int &ports_found, FailedPortList &failed_ports) { char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF]; insp_sockaddr client, server; @@ -409,9 +409,9 @@ int InspIRCd::BindPorts(bool bail, int &ports_found) if ((!*Type) || (!strcmp(Type,"clients"))) { - irc::portparser portrange(configToken); + irc::portparser portrange(configToken, false); long portno = -1; - while (portno = portrange.GetToken()) + while ((portno = portrange.GetToken())) { if (!HasPort(portno, Addr)) { @@ -439,6 +439,7 @@ int InspIRCd::BindPorts(bool bail, int &ports_found) if (fd == ERROR) { this->Log(DEBUG,"Bad fd %d binding port [%s:%d]",fd,Config->addrs[count],Config->ports[count]); + failed_ports.push_back(std::make_pair(Config->addrs[count],Config->ports[count])); } else { @@ -451,6 +452,7 @@ int InspIRCd::BindPorts(bool bail, int &ports_found) shutdown(Config->openSockfd[BoundPortCount]->GetFd(),2); close(Config->openSockfd[BoundPortCount]->GetFd()); delete Config->openSockfd[BoundPortCount]; + failed_ports.push_back(std::make_pair(Config->addrs[count],Config->ports[count])); } else BoundPortCount++; @@ -475,6 +477,7 @@ int InspIRCd::BindPorts(bool bail, int &ports_found) if (fd == ERROR) { this->Log(DEBUG,"Bad fd %d binding port [%s:%d]",fd,Config->addrs[count],Config->ports[count]); + failed_ports.push_back(std::make_pair(Config->addrs[count],Config->ports[count])); } else { @@ -483,6 +486,8 @@ int InspIRCd::BindPorts(bool bail, int &ports_found) { BoundPortCount++; } + else + failed_ports.push_back(std::make_pair(Config->addrs[count],Config->ports[count])); } } return BoundPortCount;