aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-23 11:09:17 +0000
committerGravatar Sadie Powell2023-01-23 13:07:53 +0000
commit9db9d5abe4abd975cd8725283f2efcd4bcae5f8e (patch)
tree8ba590ee769bdbe5338cfcfecc68a395386c3425 /src/modules/m_spanningtree
parentReplace VAFORMAT/InspIRCd::Format/... with fmt::sprintf. (diff)
Convert WriteToSnoMask/WriteGlobalSno to use fmtlib format strings.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/addline.cpp18
-rw-r--r--src/modules/m_spanningtree/capab.cpp6
-rw-r--r--src/modules/m_spanningtree/delline.cpp4
-rw-r--r--src/modules/m_spanningtree/hmac.cpp8
-rw-r--r--src/modules/m_spanningtree/main.cpp20
-rw-r--r--src/modules/m_spanningtree/netburst.cpp4
-rw-r--r--src/modules/m_spanningtree/opertype.cpp5
-rw-r--r--src/modules/m_spanningtree/override_squit.cpp2
-rw-r--r--src/modules/m_spanningtree/pingtimer.cpp2
-rw-r--r--src/modules/m_spanningtree/pong.cpp2
-rw-r--r--src/modules/m_spanningtree/rconnect.cpp4
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp8
-rw-r--r--src/modules/m_spanningtree/rsquit.cpp2
-rw-r--r--src/modules/m_spanningtree/server.cpp4
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp6
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp10
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp10
-rw-r--r--src/modules/m_spanningtree/uid.cpp4
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
19 files changed, 60 insertions, 61 deletions
diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp
index 92598fb69..0e8e8ab2d 100644
--- a/src/modules/m_spanningtree/addline.cpp
+++ b/src/modules/m_spanningtree/addline.cpp
@@ -39,7 +39,7 @@ CmdResult CommandAddLine::Handle(User* usr, Params& params)
if (!xlf)
{
- ServerInstance->SNO.WriteToSnoMask('x', "%s sent me an unknown ADDLINE type (%s).", setter.c_str(), params[0].c_str());
+ ServerInstance->SNO.WriteToSnoMask('x', "{} sent me an unknown ADDLINE type ({}).", setter, params[0]);
return CmdResult::FAILURE;
}
@@ -50,7 +50,7 @@ CmdResult CommandAddLine::Handle(User* usr, Params& params)
}
catch (const ModuleException& e)
{
- ServerInstance->SNO.WriteToSnoMask('x', "Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason().c_str());
+ ServerInstance->SNO.WriteToSnoMask('x', "Unable to ADDLINE type {} from {}: {}", params[0], setter, e.GetReason());
return CmdResult::FAILURE;
}
xl->SetCreateTime(ServerCommand::ExtractTS(params[3]));
@@ -58,16 +58,16 @@ CmdResult CommandAddLine::Handle(User* usr, Params& params)
{
if (xl->duration)
{
- ServerInstance->SNO.WriteToSnoMask('X', "%s added a timed %s%s on %s, expires in %s (on %s): %s",
- setter.c_str(), params[0].c_str(), params[0].length() == 1 ? "-line" : "",
- params[1].c_str(), Duration::ToString(xl->duration).c_str(),
- InspIRCd::TimeString(xl->expiry).c_str(), params[5].c_str());
+ ServerInstance->SNO.WriteToSnoMask('X', "{} added a timed {}{} on {}, expires in {} (on {}): {}",
+ setter, params[0], params[0].length() == 1 ? "-line" : "",
+ params[1], Duration::ToString(xl->duration),
+ InspIRCd::TimeString(xl->expiry), params[5]);
}
else
{
- ServerInstance->SNO.WriteToSnoMask('X', "%s added a permanent %s%s on %s: %s",
- setter.c_str(), params[0].c_str(), params[0].length() == 1 ? "-line" : "",
- params[1].c_str(), params[5].c_str());
+ ServerInstance->SNO.WriteToSnoMask('X', "{} added a permanent {}{} on {}: {}",
+ setter, params[0], params[0].length() == 1 ? "-line" : "",
+ params[1], params[5]);
}
TreeServer* remoteserver = TreeServer::Get(usr);
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp
index 5ae7f5ff0..a59a73a3b 100644
--- a/src/modules/m_spanningtree/capab.cpp
+++ b/src/modules/m_spanningtree/capab.cpp
@@ -528,9 +528,9 @@ bool TreeSocket::Capab(const CommandBase::Params& params)
if (Utils->AllowOptCommon)
{
ServerInstance->SNO.WriteToSnoMask('l',
- "ExtBan lists do not match, some bans/exemptions may not work globally.%s%s%s%s",
- missing_here.length() ? " Not loaded here:" : "", missing_here.c_str(),
- missing_there.length() ? " Not loaded there:" : "", missing_there.c_str());
+ "ExtBan lists do not match, some bans/exemptions may not work globally.{}{}{}{}",
+ missing_here.length() ? " Not loaded here:" : "", missing_here,
+ missing_there.length() ? " Not loaded there:" : "", missing_there);
}
else
{
diff --git a/src/modules/m_spanningtree/delline.cpp b/src/modules/m_spanningtree/delline.cpp
index 5de195ed8..d1ec8ac7f 100644
--- a/src/modules/m_spanningtree/delline.cpp
+++ b/src/modules/m_spanningtree/delline.cpp
@@ -36,8 +36,8 @@ CmdResult CommandDelLine::Handle(User* user, Params& params)
// XLineManager::DelLine() returns true if the xline existed, false if it didn't
if (ServerInstance->XLines->DelLine(params[1].c_str(), params[0], reason, user))
{
- ServerInstance->SNO.WriteToSnoMask('X', "%s removed %s%s on %s: %s", setter.c_str(),
- params[0].c_str(), params[0].length() == 1 ? "-line" : "", params[1].c_str(), reason.c_str());
+ ServerInstance->SNO.WriteToSnoMask('X', "{} removed {}{} on {}: {}", setter,
+ params[0], params[0].length() == 1 ? "-line" : "", params[1], reason);
return CmdResult::SUCCESS;
}
return CmdResult::FAILURE;
diff --git a/src/modules/m_spanningtree/hmac.cpp b/src/modules/m_spanningtree/hmac.cpp
index 2539a4f05..ce4e02e5c 100644
--- a/src/modules/m_spanningtree/hmac.cpp
+++ b/src/modules/m_spanningtree/hmac.cpp
@@ -79,8 +79,8 @@ bool TreeSocket::ComparePass(const Link& link, const std::string& theirs)
/* Require fingerprint to exist and match */
if (link.Fingerprint != fp)
{
- ServerInstance->SNO.WriteToSnoMask('l', "Invalid TLS certificate fingerprint on link %s: need \"%s\" got \"%s\"",
- link.Name.c_str(), link.Fingerprint.c_str(), fp.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "Invalid TLS certificate fingerprint on link {}: need \"{}\" got \"{}\"",
+ link.Name, link.Fingerprint, fp);
SendError("Invalid TLS certificate fingerprint " + fp + " - expected " + link.Fingerprint);
return false;
}
@@ -105,8 +105,8 @@ bool TreeSocket::ComparePass(const Link& link, const std::string& theirs)
// this time
if ((!capab->auth_fingerprint) && (!fp.empty()))
{
- ServerInstance->SNO.WriteToSnoMask('l', "TLS certificate fingerprint for link %s is \"%s\". "
- "You can improve security by specifying this in <link:fingerprint>.", link.Name.c_str(), fp.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "TLS certificate fingerprint for link {} is \"{}\". "
+ "You can improve security by specifying this in <link:fingerprint>.", link.Name, fp);
}
return true;
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 833e633df..76aed1476 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -201,7 +201,7 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Autoconnect>& a, bo
std::shared_ptr<Link> x = Utils->FindLink(a->servers[a->position]);
if (x)
{
- ServerInstance->SNO.WriteToSnoMask('l', "AUTOCONNECT: Auto-connecting server \002%s\002", x->Name.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "AUTOCONNECT: Auto-connecting server \002{}\002", x->Name);
ConnectServer(x, a);
return;
}
@@ -227,8 +227,8 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Link>& x, const std
{
// We don't use the family() != AF_UNSPEC check below for UNIX sockets as
// that results in a DNS lookup.
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s is not a UNIX socket!",
- x->Name.c_str(), x->IPAddr.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: {} is not a UNIX socket!",
+ x->Name, x->IPAddr);
return;
}
}
@@ -245,14 +245,14 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Link>& x, const std
auto* newsocket = new TreeSocket(x, y, sa);
if (!newsocket->HasFd())
{
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",
- x->Name.c_str(), newsocket->GetError().c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: {}.",
+ x->Name, newsocket->GetError());
ServerInstance->GlobalCulls.AddItem(newsocket);
}
}
else if (!DNS)
{
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: Hostname given and core_dns is not loaded, unable to resolve.", x->Name.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: Hostname given and core_dns is not loaded, unable to resolve.", x->Name);
}
else
{
@@ -273,7 +273,7 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Link>& x, const std
catch (const DNS::Exception& e)
{
delete snr;
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.", x->Name.c_str(), e.GetReason().c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: {}.", x->Name, e.GetReason());
ConnectServer(y, false);
}
}
@@ -307,7 +307,7 @@ void ModuleSpanningTree::DoConnectTimeout(time_t curtime)
}
else if (curtime > s->age + (time_t)p.second)
{
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002 (timeout of %u seconds)", p.first.c_str(), p.second);
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002 (timeout of {} seconds)", p.first, p.second);
Utils->timeoutlist.erase(me);
s->Close();
}
@@ -610,8 +610,8 @@ void ModuleSpanningTree::OnUserQuit(User* user, const std::string& reason, const
bool hide = (((server->IsDead()) && (Utils->quiet_bursts)) || (server->IsSilentService()));
if (!hide)
{
- ServerInstance->SNO.WriteToSnoMask('Q', "Client exiting on server %s: %s (%s) [%s]",
- user->server->GetName().c_str(), user->GetFullRealHost().c_str(), user->GetIPString().c_str(), oper_message.c_str());
+ ServerInstance->SNO.WriteToSnoMask('Q', "Client exiting on server {}: {} ({}) [{}]", user->server->GetName(),
+ user->GetFullRealHost(), user->GetIPString(), oper_message);
}
}
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 9e9d66bb7..3f4d2defe 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -101,8 +101,8 @@ struct TreeSocket::BurstState final
*/
void TreeSocket::DoBurst(TreeServer* s)
{
- ServerInstance->SNO.WriteToSnoMask('l', "Bursting to \002%s\002 (Authentication: %s%s).",
- s->GetName().c_str(),
+ ServerInstance->SNO.WriteToSnoMask('l', "Bursting to \002{}\002 (Authentication: {}{}).",
+ s->GetName(),
capab->auth_fingerprint ? "TLS certificate fingerprint and " : "",
capab->auth_challenge ? "challenge-response" : "plaintext password");
this->CleanNegotiationInfo();
diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp
index 36fedb94d..74892d4b3 100644
--- a/src/modules/m_spanningtree/opertype.cpp
+++ b/src/modules/m_spanningtree/opertype.cpp
@@ -109,9 +109,8 @@ CmdResult CommandOpertype::HandleRemote(RemoteUser* u, CommandBase::Params& para
u->oper->GetName().c_str());
}
- ServerInstance->SNO.WriteToSnoMask('O', "From %s: %s (%s) [%s] is now a server operator of type \x02%s\x02%s.",
- u->server->GetName().c_str(), u->nick.c_str(), u->MakeHost().c_str(), u->GetIPString().c_str(),
- u->oper->GetType().c_str(), extra.c_str());
+ ServerInstance->SNO.WriteToSnoMask('O', "From {}: {} ({}) [{}] is now a server operator of type \x02{}\x02{}.",
+ u->server->GetName(), u->nick, u->MakeHost(), u->GetIPString(), u->oper->GetType(), extra);
return CmdResult::SUCCESS;
}
diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp
index 82644d3c0..95bd2fea3 100644
--- a/src/modules/m_spanningtree/override_squit.cpp
+++ b/src/modules/m_spanningtree/override_squit.cpp
@@ -44,7 +44,7 @@ ModResult ModuleSpanningTree::HandleSquit(const CommandBase::Params& parameters,
if (s->IsLocal())
{
- ServerInstance->SNO.WriteToSnoMask('l', "SQUIT: Server \002%s\002 removed from network by %s", parameters[0].c_str(), user->nick.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "SQUIT: Server \002{}\002 removed from network by {}", parameters[0], user->nick);
s->SQuit("Server quit by " + user->GetFullRealHost());
}
else
diff --git a/src/modules/m_spanningtree/pingtimer.cpp b/src/modules/m_spanningtree/pingtimer.cpp
index d42295eb7..6e2d498d5 100644
--- a/src/modules/m_spanningtree/pingtimer.cpp
+++ b/src/modules/m_spanningtree/pingtimer.cpp
@@ -48,7 +48,7 @@ PingTimer::State PingTimer::TickInternal()
else if (state == PS_WARN)
{
// No pong arrived in PingWarnTime seconds, send a warning to opers
- ServerInstance->SNO.WriteToSnoMask('l', "Server \002%s\002 has not responded to PING for %lu seconds, high latency.", server->GetName().c_str(), GetInterval());
+ ServerInstance->SNO.WriteToSnoMask('l', "Server \002{}\002 has not responded to PING for {} seconds, high latency.", server->GetName(), GetInterval());
return PS_TIMEOUT;
}
else // PS_TIMEOUT
diff --git a/src/modules/m_spanningtree/pong.cpp b/src/modules/m_spanningtree/pong.cpp
index d3fc09634..7d137eef9 100644
--- a/src/modules/m_spanningtree/pong.cpp
+++ b/src/modules/m_spanningtree/pong.cpp
@@ -31,7 +31,7 @@ CmdResult CommandPong::HandleServer(TreeServer* server, CommandBase::Params& par
{
if (server->IsBursting())
{
- ServerInstance->SNO.WriteGlobalSno('l', "Server \002%s\002 has not finished burst, forcing end of burst (send ENDBURST!)", server->GetName().c_str());
+ ServerInstance->SNO.WriteGlobalSno('l', "Server \002{}\002 has not finished burst, forcing end of burst (send ENDBURST!)", server->GetName());
server->FinishBurst();
}
diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp
index e8e145f25..7991f8924 100644
--- a/src/modules/m_spanningtree/rconnect.cpp
+++ b/src/modules/m_spanningtree/rconnect.cpp
@@ -50,8 +50,8 @@ CmdResult CommandRConnect::Handle(User* user, const Params& parameters)
if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0]))
{
/* Yes, initiate the given connect */
- ServerInstance->SNO.WriteToSnoMask('l', "Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",
- user->nick.c_str(), parameters[0].c_str(), parameters[1].c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "Remote CONNECT from {} matching \002{}\002, connecting server \002{}\002",
+ user->nick, parameters[0], parameters[1]);
CommandBase::Params para;
para.push_back(parameters[1]);
((ModuleSpanningTree*)(Module*)creator)->HandleConnect(para, user);
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp
index e6dd2a54a..8bf2ab0f6 100644
--- a/src/modules/m_spanningtree/resolvers.cpp
+++ b/src/modules/m_spanningtree/resolvers.cpp
@@ -69,8 +69,8 @@ void ServerNameResolver::OnLookupComplete(const DNS::Query* r)
if (!newsocket->HasFd())
{
/* Something barfed, show the opers */
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",
- link->Name.c_str(), newsocket->GetError().c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: {}.",
+ link->Name, newsocket->GetError());
ServerInstance->GlobalCulls.AddItem(newsocket);
}
}
@@ -98,8 +98,8 @@ void ServerNameResolver::OnError(const DNS::Query* r)
}
}
- ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: Unable to resolve hostname - %s",
- link->Name.c_str(), this->manager->GetErrorStr(r->error).c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002{}\002: Unable to resolve hostname - {}",
+ link->Name, this->manager->GetErrorStr(r->error));
Utils->Creator->ConnectServer(autoconnect, false);
}
diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp
index d938a6225..d57510bb0 100644
--- a/src/modules/m_spanningtree/rsquit.cpp
+++ b/src/modules/m_spanningtree/rsquit.cpp
@@ -58,7 +58,7 @@ CmdResult CommandRSQuit::Handle(User* user, const Params& parameters)
{
// We have been asked to remove server_target.
const char* reason = parameters.size() == 2 ? parameters[1].c_str() : "No reason";
- ServerInstance->SNO.WriteToSnoMask('l', "RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick.c_str(), reason);
+ ServerInstance->SNO.WriteToSnoMask('l', "RSQUIT: Server \002{}\002 removed from network by {} ({})", parameters[0], user->nick, reason);
server_target->SQuit("Server quit by " + user->GetFullRealHost() + " (" + reason + ")");
}
diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp
index 162fd92ee..ab5111622 100644
--- a/src/modules/m_spanningtree/server.cpp
+++ b/src/modules/m_spanningtree/server.cpp
@@ -124,7 +124,7 @@ std::shared_ptr<Link> TreeSocket::AuthRemote(const CommandBase::Params& params)
if (!ComparePass(*x, password))
{
- ServerInstance->SNO.WriteToSnoMask('l', "Invalid password on link: %s", x->Name.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "Invalid password on link: {}", x->Name);
continue;
}
@@ -136,7 +136,7 @@ std::shared_ptr<Link> TreeSocket::AuthRemote(const CommandBase::Params& params)
{
std::string ciphersuite;
ssliohook->GetCiphersuite(ciphersuite);
- ServerInstance->SNO.WriteToSnoMask('l', "Negotiated ciphersuite %s on link %s", ciphersuite.c_str(), x->Name.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "Negotiated ciphersuite {} on link {}", ciphersuite, x->Name);
}
else if (!capab->remotesa.is_local())
{
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index ed84ca70f..75e857ba6 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -153,8 +153,8 @@ void TreeServer::FinishBurst()
ServerInstance->XLines->ApplyLines();
uint64_t ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000);
unsigned long bursttime = ts - this->StartBurst;
- ServerInstance->SNO.WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \002%s\002 (burst time: %lu %s)",
- GetName().c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
+ ServerInstance->SNO.WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \002{}\002 (burst time: {} {})",
+ GetName(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
Utils->Creator->linkeventprov.Call(&ServerProtocol::LinkEventListener::OnServerBurst, this);
StartBurst = 0;
@@ -182,7 +182,7 @@ void TreeServer::SQuitChild(TreeServer* server, const std::string& reason, bool
const std::string quitreason = GetName() + " " + server->GetName();
size_t num_lost_users = QuitUsers(quitreason);
- ServerInstance->SNO.WriteToSnoMask(IsRoot() ? 'l' : 'L', "Netsplit complete, lost \002%zu\002 user%s on \002%u\002 server%s.",
+ ServerInstance->SNO.WriteToSnoMask(IsRoot() ? 'l' : 'L', "Netsplit complete, lost \002{}\002 user{} on \002{}\002 server{}.",
num_lost_users, num_lost_users != 1 ? "s" : "", num_lost_servers, num_lost_servers != 1 ? "s" : "");
// No-op if the socket is already closed (i.e. it called us)
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 2da154642..68caaa722 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -136,16 +136,16 @@ void TreeSocket::OnConnected()
static_cast<IOHookProvider*>(prov)->OnConnect(this);
}
- ServerInstance->SNO.WriteGlobalSno('l', "Connection to \002%s\002[%s] started.", linkID.c_str(),
- (capab->link->HiddenFromStats ? "<hidden>" : capab->link->IPAddr.c_str()));
+ ServerInstance->SNO.WriteGlobalSno('l', "Connection to \002{}\002[{}] started.", linkID,
+ (capab->link->HiddenFromStats ? "<hidden>" : capab->link->IPAddr));
this->SendCapabilities(1);
}
}
void TreeSocket::OnError(BufferedSocketError e)
{
- ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002%s\002' failed with error: %s",
- linkID.c_str(), GetError().c_str());
+ ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002{}\002' failed with error: {}",
+ linkID, GetError());
LinkState = DYING;
Close();
}
@@ -236,7 +236,7 @@ static std::string newline("\n");
void TreeSocket::WriteLineInternal(const std::string& line)
{
- ServerInstance->Logs.RawIO(MODNAME, "S[%d] O %s", this->GetFd(), line.c_str());
+ ServerInstance->Logs.RawIO(MODNAME, "S[{}] O {}", GetFd(), line);
this->WriteData(line);
this->WriteData(newline);
}
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 4c4e71fbd..5290bf498 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -165,13 +165,13 @@ void TreeSocket::ProcessLine(std::string& line)
time_t delta = them - ServerInstance->Time();
if ((delta < -15) || (delta > 15))
{
- ServerInstance->SNO.WriteGlobalSno('l', "\002ERROR\002: Your clocks are off by %ld seconds (this is more than fifteen seconds). Link aborted, \002PLEASE SYNC YOUR CLOCKS!\002", labs((long)delta));
+ ServerInstance->SNO.WriteGlobalSno('l', "\002ERROR\002: Your clocks are off by {} seconds (this is more than fifteen seconds). Link aborted, \002PLEASE SYNC YOUR CLOCKS!\002", labs((long)delta));
SendError("Your clocks are out by "+ConvToStr(labs((long)delta))+" seconds (this is more than fifteen seconds). Link aborted, PLEASE SYNC YOUR CLOCKS!");
return;
}
else if ((delta < -5) || (delta > 5))
{
- ServerInstance->SNO.WriteGlobalSno('l', "\002WARNING\002: Your clocks are off by %ld seconds. Please consider syncing your clocks.", labs((long)delta));
+ ServerInstance->SNO.WriteGlobalSno('l', "\002WARNING\002: Your clocks are off by {} seconds. Please consider syncing your clocks.", labs((long)delta));
}
}
@@ -395,7 +395,7 @@ void TreeSocket::ProcessConnectedLine(std::string& taglist, std::string& prefix,
void TreeSocket::OnTimeout()
{
- ServerInstance->SNO.WriteGlobalSno('l', "CONNECT: Connection to \002%s\002 timed out.", linkID.c_str());
+ ServerInstance->SNO.WriteGlobalSno('l', "CONNECT: Connection to \002{}\002 timed out.", linkID);
}
void TreeSocket::Close()
@@ -413,13 +413,13 @@ void TreeSocket::Close()
if (MyRoot && !MyRoot->IsDead())
MyRoot->SQuit(GetError(), true);
else
- ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002%s\002' failed.", linkID.c_str());
+ ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002{}\002' failed.", linkID);
time_t server_uptime = ServerInstance->Time() - this->age;
if (server_uptime)
{
std::string timestr = Duration::ToString(server_uptime);
- ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002%s\002' was established for %s", linkID.c_str(), timestr.c_str());
+ ServerInstance->SNO.WriteGlobalSno('l', "Connection to '\002{}\002' was established for {}", linkID, timestr);
}
}
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index e5e534d8c..96dfa9fff 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -136,8 +136,8 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
if (dosend)
{
- ServerInstance->SNO.WriteToSnoMask('C', "Client connecting at %s: %s (%s) [%s\x0F]", remoteserver->GetName().c_str(),
- _new->GetFullRealHost().c_str(), _new->GetIPString().c_str(), _new->GetRealName().c_str());
+ ServerInstance->SNO.WriteToSnoMask('C', "Client connecting at {}: {} ({}) [{}\x0F]", remoteserver->GetName(),
+ _new->GetFullRealHost(), _new->GetIPString(), _new->GetRealName());
}
FOREACH_MOD(OnPostConnect, (_new));
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 42a331ab6..3a0ec1cfc 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -51,7 +51,7 @@ ModResult ModuleSpanningTree::OnAcceptConnection(int newsock, ListenSocket* from
return MOD_RES_ALLOW;
}
}
- ServerInstance->SNO.WriteToSnoMask('l', "Server connection from %s denied (no link blocks with that IP address)", incomingip.c_str());
+ ServerInstance->SNO.WriteToSnoMask('l', "Server connection from {} denied (no link blocks with that IP address)", incomingip);
return MOD_RES_DENY;
}