summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-07-01 22:55:39 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-07-01 22:55:39 +0000
commit50eebfeac8ebe501b021ebf62b0b01464fd79a21 (patch)
tree85c26ff8bdbacd6e3b43cc68bd78fd22ba892420 /src/socket.cpp
parentc9fed3cb0d87aabbb440f6a14a72601a7f99e8e9 (diff)
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
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp12
1 files changed, 6 insertions, 6 deletions
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<std::pair<std::string, int> > old_ports;
/* XXX: Make a copy of the old ip/port pairs here */
- for (std::vector<ListenSocketBase *>::iterator o = Config->ports.begin(); o != Config->ports.end(); ++o)
+ for (std::vector<ListenSocketBase *>::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<ListenSocketBase *>::iterator n = Config->ports.begin(); n != Config->ports.end(); ++n)
+ for (std::vector<ListenSocketBase *>::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<ListenSocketBase *>::iterator n = Config->ports.begin(); n != Config->ports.end(); ++n)
+ for (std::vector<ListenSocketBase *>::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;
}
}