From 50eebfeac8ebe501b021ebf62b0b01464fd79a21 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 1 Jul 2009 22:55:39 +0000 Subject: Move list of open ports out of Config object git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11423 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index cdf624321..35feda01f 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -183,11 +183,11 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports) { char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF]; int bound = 0; - bool started_with_nothing = (Config->ports.size() == 0); + bool started_with_nothing = (ports.size() == 0); std::vector > old_ports; /* XXX: Make a copy of the old ip/port pairs here */ - for (std::vector::iterator o = Config->ports.begin(); o != Config->ports.end(); ++o) + for (std::vector::iterator o = ports.begin(); o != ports.end(); ++o) old_ports.push_back(make_pair((*o)->GetIP(), (*o)->GetPort())); for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++) @@ -209,7 +209,7 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports) *Addr = 0; bool skip = false; - for (std::vector::iterator n = Config->ports.begin(); n != Config->ports.end(); ++n) + for (std::vector::iterator n = ports.begin(); n != ports.end(); ++n) { if (((*n)->GetIP() == Addr) && ((*n)->GetPort() == portno)) { @@ -231,7 +231,7 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports) if (ll->GetFd() > -1) { bound++; - Config->ports.push_back(ll); + ports.push_back(ll); } else { @@ -248,13 +248,13 @@ int InspIRCd::BindPorts(bool, int &ports_found, FailedPortList &failed_ports) { for (size_t k = 0; k < old_ports.size(); ++k) { - for (std::vector::iterator n = Config->ports.begin(); n != Config->ports.end(); ++n) + for (std::vector::iterator n = ports.begin(); n != ports.end(); ++n) { if (((*n)->GetIP() == old_ports[k].first) && ((*n)->GetPort() == old_ports[k].second)) { this->Logs->Log("SOCKET",DEFAULT,"Port binding %s:%d was removed from the config file, closing.", old_ports[k].first.c_str(), old_ports[k].second); delete *n; - Config->ports.erase(n); + ports.erase(n); break; } } -- cgit v1.2.3