From a5fc0da690ea62c3a76ca2cceaa2ab344a93fce3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Aug 2024 14:09:21 +0100 Subject: Fix the case of some InspIRCd class member variables. --- src/inspircd.cpp | 7 +++---- src/socket.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 94d19f80f..882cb2e79 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -377,12 +377,12 @@ namespace void InspIRCd::Cleanup() { // Close all listening sockets - for (auto* port : ports) + for (auto* port : Ports) { port->Cull(); delete port; } - ports.clear(); + Ports.clear(); // Tell modules that we're shutting down. const std::string quitmsg = "Server shutting down"; @@ -434,12 +434,11 @@ void InspIRCd::WritePID() } InspIRCd::InspIRCd(int argc, char** argv) + : StartTime(time(NULL)) { ServerInstance = this; UpdateTime(); - this->startup_time = Time(); - IncreaseCoreDumpSize(); SocketEngine::Init(); diff --git a/src/socket.cpp b/src/socket.cpp index 2ec6d16b3..9f520df16 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -79,14 +79,14 @@ bool InspIRCd::BindPort(const std::shared_ptr& tag, const irc::socket } ServerInstance->Logs.Debug("SOCKET", "Added a listener on {} from tag at {}", sa.str(), tag->source.str()); - ports.push_back(ll); + Ports.push_back(ll); return true; } size_t InspIRCd::BindPorts(FailedPortList& failed_ports) { size_t bound = 0; - std::vector old_ports(ports.begin(), ports.end()); + std::vector old_ports(Ports.begin(), Ports.end()); for (const auto& [_, tag] : ServerInstance->Config->ConfTags("bind")) { @@ -209,12 +209,12 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) } } - std::vector::iterator n = ports.begin(); + std::vector::iterator n = Ports.begin(); for (auto* old_port : old_ports) { - while (n != ports.end() && *n != old_port) + while (n != Ports.end() && *n != old_port) n++; - if (n == ports.end()) + if (n == Ports.end()) { this->Logs.Warning("SOCKET", "Port bindings slipped out of vector, aborting close!"); break; @@ -225,7 +225,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) delete *n; // this keeps the iterator valid, pointing to the next element - n = ports.erase(n); + n = Ports.erase(n); } return bound; -- cgit v1.3.1-10-gc9f91