mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
moved creation time to TransportSession
This commit is contained in:
parent
000e0358a7
commit
6f7ab49346
|
@ -41,7 +41,6 @@ namespace transport
|
||||||
i2p::context.GetRouterInfo ().GetSSUAddress (true);
|
i2p::context.GetRouterInfo ().GetSSUAddress (true);
|
||||||
if (address) m_IntroKey = address->i;
|
if (address) m_IntroKey = address->i;
|
||||||
}
|
}
|
||||||
m_CreationTime = i2p::util::GetSecondsSinceEpoch ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SSUSession::~SSUSession ()
|
SSUSession::~SSUSession ()
|
||||||
|
|
|
@ -103,8 +103,6 @@ namespace transport
|
||||||
void SendKeepAlive ();
|
void SendKeepAlive ();
|
||||||
uint32_t GetRelayTag () const { return m_RelayTag; };
|
uint32_t GetRelayTag () const { return m_RelayTag; };
|
||||||
const i2p::data::RouterInfo::IntroKey& GetIntroKey () const { return m_IntroKey; };
|
const i2p::data::RouterInfo::IntroKey& GetIntroKey () const { return m_IntroKey; };
|
||||||
uint32_t GetCreationTime () const { return m_CreationTime; };
|
|
||||||
void SetCreationTime (uint32_t ts) { m_CreationTime = ts; }; // for introducers
|
|
||||||
|
|
||||||
void FlushData ();
|
void FlushData ();
|
||||||
void CleanUp (uint64_t ts);
|
void CleanUp (uint64_t ts);
|
||||||
|
@ -167,7 +165,6 @@ namespace transport
|
||||||
i2p::crypto::AESKey m_SessionKey;
|
i2p::crypto::AESKey m_SessionKey;
|
||||||
i2p::crypto::MACKey m_MacKey;
|
i2p::crypto::MACKey m_MacKey;
|
||||||
i2p::data::RouterInfo::IntroKey m_IntroKey;
|
i2p::data::RouterInfo::IntroKey m_IntroKey;
|
||||||
uint32_t m_CreationTime; // seconds since epoch
|
|
||||||
SSUData m_Data;
|
SSUData m_Data;
|
||||||
bool m_IsDataReceived;
|
bool m_IsDataReceived;
|
||||||
std::unique_ptr<SignedData> m_SignedData; // we need it for SessionConfirmed only
|
std::unique_ptr<SignedData> m_SignedData; // we need it for SessionConfirmed only
|
||||||
|
|
|
@ -79,6 +79,7 @@ namespace transport
|
||||||
{
|
{
|
||||||
if (router)
|
if (router)
|
||||||
m_RemoteIdentity = router->GetRouterIdentity ();
|
m_RemoteIdentity = router->GetRouterIdentity ();
|
||||||
|
m_CreationTime = m_LastActivityTimestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~TransportSession () {};
|
virtual ~TransportSession () {};
|
||||||
|
@ -106,6 +107,9 @@ namespace transport
|
||||||
bool IsTerminationTimeoutExpired (uint64_t ts) const
|
bool IsTerminationTimeoutExpired (uint64_t ts) const
|
||||||
{ return ts >= m_LastActivityTimestamp + GetTerminationTimeout (); };
|
{ return ts >= m_LastActivityTimestamp + GetTerminationTimeout (); };
|
||||||
|
|
||||||
|
uint32_t GetCreationTime () const { return m_CreationTime; };
|
||||||
|
void SetCreationTime (uint32_t ts) { m_CreationTime = ts; }; // for introducers
|
||||||
|
|
||||||
virtual uint32_t GetRelayTag () const { return 0; };
|
virtual uint32_t GetRelayTag () const { return 0; };
|
||||||
virtual void SendLocalRouterInfo (bool update = false) { SendI2NPMessages ({ CreateDatabaseStoreMsg () }); };
|
virtual void SendLocalRouterInfo (bool update = false) { SendI2NPMessages ({ CreateDatabaseStoreMsg () }); };
|
||||||
virtual void SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs) = 0;
|
virtual void SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs) = 0;
|
||||||
|
@ -118,6 +122,7 @@ namespace transport
|
||||||
bool m_IsOutgoing;
|
bool m_IsOutgoing;
|
||||||
int m_TerminationTimeout;
|
int m_TerminationTimeout;
|
||||||
uint64_t m_LastActivityTimestamp;
|
uint64_t m_LastActivityTimestamp;
|
||||||
|
uint32_t m_CreationTime; // seconds since epoch
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue