mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
show number sent/received bytes through the status page
This commit is contained in:
parent
d7bcaaa3f7
commit
756a920c1a
5 changed files with 21 additions and 9 deletions
7
SSU.cpp
7
SSU.cpp
|
@ -19,7 +19,8 @@ namespace ssu
|
|||
const i2p::data::RouterInfo * router, bool peerTest ):
|
||||
m_Server (server), m_RemoteEndpoint (remoteEndpoint), m_RemoteRouter (router),
|
||||
m_Timer (m_Server.GetService ()), m_PeerTest (peerTest), m_State (eSessionStateUnknown),
|
||||
m_IsSessionKey (false), m_RelayTag (0), m_Data (*this)
|
||||
m_IsSessionKey (false), m_RelayTag (0), m_Data (*this),
|
||||
m_NumSentBytes (0), m_NumReceivedBytes (0)
|
||||
{
|
||||
m_DHKeysPair = i2p::transports.GetNextDHKeysPair ();
|
||||
}
|
||||
|
@ -74,6 +75,7 @@ namespace ssu
|
|||
|
||||
void SSUSession::ProcessNextMessage (uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& senderEndpoint)
|
||||
{
|
||||
m_NumReceivedBytes += len;
|
||||
if (m_State == eSessionStateIntroduced)
|
||||
{
|
||||
// HolePunch received
|
||||
|
@ -842,6 +844,7 @@ namespace ssu
|
|||
|
||||
void SSUSession::Send (const uint8_t * buf, size_t size)
|
||||
{
|
||||
m_NumSentBytes += size;
|
||||
m_Server.Send (buf, size, m_RemoteEndpoint);
|
||||
}
|
||||
|
||||
|
@ -910,7 +913,6 @@ namespace ssu
|
|||
void SSUServer::Send (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& to)
|
||||
{
|
||||
m_Socket.send_to (boost::asio::buffer (buf, len), to);
|
||||
LogPrint ("SSU sent ", len, " bytes");
|
||||
}
|
||||
|
||||
void SSUServer::Receive ()
|
||||
|
@ -923,7 +925,6 @@ namespace ssu
|
|||
{
|
||||
if (!ecode)
|
||||
{
|
||||
LogPrint ("SSU received ", bytes_transferred, " bytes");
|
||||
SSUSession * session = nullptr;
|
||||
auto it = m_Sessions.find (m_SenderEndpoint);
|
||||
if (it != m_Sessions.end ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue