Browse Source

show number of received bytes for zero-hops inbound tunnel

pull/401/head
orignal 9 years ago
parent
commit
0f56b1c943
  1. 10
      Tunnel.cpp
  2. 9
      Tunnel.h

10
Tunnel.cpp

@ -207,14 +207,18 @@ namespace tunnel @@ -207,14 +207,18 @@ namespace tunnel
}
ZeroHopsInboundTunnel::ZeroHopsInboundTunnel ():
InboundTunnel (std::make_shared<ZeroHopsTunnelConfig> ())
InboundTunnel (std::make_shared<ZeroHopsTunnelConfig> ()),
m_NumReceivedBytes (0)
{
}
void ZeroHopsInboundTunnel::SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg)
{
msg->from = shared_from_this ();
m_Endpoint.HandleDecryptedTunnelDataMsg (msg);
if (msg)
{
m_NumReceivedBytes += msg->GetLength ();
HandleI2NPMessage (msg);
}
}
void ZeroHopsInboundTunnel::Print (std::stringstream& s) const

9
Tunnel.h

@ -121,10 +121,10 @@ namespace tunnel @@ -121,10 +121,10 @@ namespace tunnel
InboundTunnel (std::shared_ptr<const TunnelConfig> config): Tunnel (config), m_Endpoint (true) {};
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;
protected:
private:
TunnelEndpoint m_Endpoint;
};
@ -136,6 +136,11 @@ namespace tunnel @@ -136,6 +136,11 @@ namespace tunnel
ZeroHopsInboundTunnel ();
void SendTunnelDataMsg (std::shared_ptr<i2p::I2NPMessage> msg);
void Print (std::stringstream& s) const;
size_t GetNumReceivedBytes () const { return m_NumReceivedBytes; };
private:
size_t m_NumReceivedBytes;
};
class Tunnels

Loading…
Cancel
Save