1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 15:44:46 +02:00

Fix the message counts in RPL_STATSLINKINFO.

This commit is contained in:
Sadie Powell
2026-03-26 11:54:23 +00:00
parent 7e2ef3774b
commit b199d74088
4 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -54,7 +54,9 @@ class UplinkSocket final
, public BufferedSocket
{
public:
bool error;
bool error = false;
size_t recv_msgs = 0;
size_t sent_msgs = 0;
UplinkSocket();
~UplinkSocket();
bool ProcessRead() override;
+2 -1
View File
@@ -402,7 +402,8 @@ void Stats::Run(MessageSource &source, const std::vector<Anope::string> &params,
if (u->HasMode("OPER"))
{
IRCD->SendNumeric(RPL_STATSLINKINFO, source.GetSource(), "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
IRCD->SendNumeric(RPL_STATSLINKINFO, source.GetSource(), Config->Uplinks[Anope::CurrentUplink].host, UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, Anope::CurTime - Anope::StartTime);
IRCD->SendNumeric(RPL_STATSLINKINFO, source.GetSource(), Config->Uplinks[Anope::CurrentUplink].host, UplinkSock->WriteBufferLen(),
TotalWritten, UplinkSock->sent_msgs, UplinkSock->ReadBufferLen(), TotalRead, UplinkSock->recv_msgs, Anope::CurTime - Anope::StartTime);
}
IRCD->SendNumeric(RPL_STATSLINKINFO, source.GetSource(), params[0][0], "End of /STATS report.");
+2
View File
@@ -18,6 +18,7 @@
#include "servers.h"
#include "users.h"
#include "regchannel.h"
#include "uplink.h"
void Anope::Process(const Anope::string &buffer)
{
@@ -86,6 +87,7 @@ void Anope::ProcessInternal(MessageSource &src, const Anope::string &command, co
{
try
{
UplinkSock->recv_msgs++;
m->Run(src, params, tags);
}
catch (const ProtocolException &err)
+1 -1
View File
@@ -76,6 +76,7 @@ void Uplink::SendInternal(const Anope::map<Anope::string> &tags, const MessageSo
if (!IRCD->Format(message, tags, source, command, params))
return;
UplinkSock->sent_msgs++;
UplinkSock->Write(message);
Log(LOG_RAWIO) << "Sent " << message;
@@ -108,7 +109,6 @@ void Uplink::SendInternal(const Anope::map<Anope::string> &tags, const MessageSo
UplinkSocket::UplinkSocket() : Socket(-1, Config->Uplinks[Anope::CurrentUplink].protocol), ConnectionSocket(), BufferedSocket()
{
error = false;
UplinkSock = this;
}