mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 09:00:30 +01:00
show number of received bytes for zero-hops inbound tunnel
This commit is contained in:
parent
d541572882
commit
0f56b1c943
2 changed files with 14 additions and 5 deletions
10
Tunnel.cpp
10
Tunnel.cpp
|
@ -207,14 +207,18 @@ namespace tunnel
|
||||||
}
|
}
|
||||||
|
|
||||||
ZeroHopsInboundTunnel::ZeroHopsInboundTunnel ():
|
ZeroHopsInboundTunnel::ZeroHopsInboundTunnel ():
|
||||||
InboundTunnel (std::make_shared<ZeroHopsTunnelConfig> ())
|
InboundTunnel (std::make_shared<ZeroHopsTunnelConfig> ()),
|
||||||
|
m_NumReceivedBytes (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZeroHopsInboundTunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg)
|
void ZeroHopsInboundTunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg)
|
||||||
{
|
{
|
||||||
msg->from = shared_from_this ();
|
if (msg)
|
||||||
m_Endpoint.HandleDecryptedTunnelDataMsg (msg);
|
{
|
||||||
|
m_NumReceivedBytes += msg->GetLength ();
|
||||||
|
HandleI2NPMessage (msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZeroHopsInboundTunnel::Print (std::stringstream& s) const
|
void ZeroHopsInboundTunnel::Print (std::stringstream& s) const
|
||||||
|
|
9
Tunnel.h
9
Tunnel.h
|
@ -121,10 +121,10 @@ namespace tunnel
|
||||||
|
|
||||||
InboundTunnel (std::shared_ptr<const TunnelConfig> config): Tunnel (config), m_Endpoint (true) {};
|
InboundTunnel (std::shared_ptr<const TunnelConfig> config): Tunnel (config), m_Endpoint (true) {};
|
||||||
void HandleTunnelDataMsg (std::shared_ptr<const I2NPMessage> msg);
|
void HandleTunnelDataMsg (std::shared_ptr<const I2NPMessage> msg);
|
||||||
size_t GetNumReceivedBytes () const { return m_Endpoint.GetNumReceivedBytes (); };
|
virtual size_t GetNumReceivedBytes () const { return m_Endpoint.GetNumReceivedBytes (); };
|
||||||
void Print (std::stringstream& s) const;
|
void Print (std::stringstream& s) const;
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
|
||||||
TunnelEndpoint m_Endpoint;
|
TunnelEndpoint m_Endpoint;
|
||||||
};
|
};
|
||||||
|
@ -136,6 +136,11 @@ namespace tunnel
|
||||||
ZeroHopsInboundTunnel ();
|
ZeroHopsInboundTunnel ();
|
||||||
void SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg);
|
void SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg);
|
||||||
void Print (std::stringstream& s) const;
|
void Print (std::stringstream& s) const;
|
||||||
|
size_t GetNumReceivedBytes () const { return m_NumReceivedBytes; };
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
size_t m_NumReceivedBytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Tunnels
|
class Tunnels
|
||||||
|
|
Loading…
Add table
Reference in a new issue