mirror of
https://github.com/anope/anope.git
synced 2026-06-12 17:24:49 +02:00
Fix the message counts in RPL_STATSLINKINFO.
This commit is contained in:
+3
-1
@@ -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
@@ -402,7 +402,8 @@ void Stats::Run(MessageSource &source, const std::vector<Anope::string> ¶ms,
|
||||
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.");
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user