summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-08-28 15:37:15 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-12 15:05:24 +0100
commitfb13dca410541f01db84287f2721d1e256eaf2b5 (patch)
tree53b1c9de79ba80719a7e054de455d86c27676384 /src/socket.cpp
parent3b595d39a50e38283768bc6ec8aeb9e73071224f (diff)
Store the server endpoint as a sockaddrs in ListenSocket.
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 0ba57a810..a5c1c679a 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -45,12 +45,11 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
irc::sockets::sockaddrs bindspec;
if (!irc::sockets::aptosa(Addr, portno, bindspec))
continue;
- std::string bind_readable = bindspec.str();
bool skip = false;
for (std::vector<ListenSocket*>::iterator n = old_ports.begin(); n != old_ports.end(); ++n)
{
- if ((**n).bind_desc == bind_readable)
+ if ((**n).bind_sa == bindspec)
{
(*n)->bind_tag = tag; // Replace tag, we know addr and port match, but other info (type, ssl) may not
(*n)->ResetIOHookProvider();
@@ -71,7 +70,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
}
else
{
- failed_ports.push_back(std::make_pair(bind_readable, strerror(errno)));
+ failed_ports.push_back(std::make_pair(bindspec.str(), strerror(errno)));
delete ll;
}
}
@@ -90,7 +89,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
}
this->Logs->Log("SOCKET", LOG_DEFAULT, "Port binding %s was removed from the config file, closing.",
- (**n).bind_desc.c_str());
+ (**n).bind_sa.str().c_str());
delete *n;
// this keeps the iterator valid, pointing to the next element