mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
unconfirmed tags
This commit is contained in:
parent
0cdb7c679e
commit
8a12b71010
12
Garlic.cpp
12
Garlic.cpp
@ -45,6 +45,9 @@ namespace garlic
|
||||
|
||||
GarlicRoutingSession::~GarlicRoutingSession ()
|
||||
{
|
||||
for (auto it: m_UnconfirmedTagsMsgs)
|
||||
delete it.second;
|
||||
m_UnconfirmedTagsMsgs.clear ();
|
||||
delete[] m_SessionTags;
|
||||
}
|
||||
|
||||
@ -59,6 +62,15 @@ namespace garlic
|
||||
}
|
||||
}
|
||||
|
||||
void GarlicRoutingSession::TagsConfirmed (uint32_t msgID)
|
||||
{
|
||||
auto it = m_UnconfirmedTagsMsgs.find (msgID);
|
||||
if (it != m_UnconfirmedTagsMsgs.end ())
|
||||
{
|
||||
}
|
||||
m_IsAcknowledged = true;
|
||||
}
|
||||
|
||||
I2NPMessage * GarlicRoutingSession::WrapSingleMessage (I2NPMessage * msg)
|
||||
{
|
||||
I2NPMessage * m = NewI2NPMessage ();
|
||||
|
14
Garlic.h
14
Garlic.h
@ -43,6 +43,15 @@ namespace garlic
|
||||
class GarlicDestination;
|
||||
class GarlicRoutingSession
|
||||
{
|
||||
struct UnconfirmedTags
|
||||
{
|
||||
UnconfirmedTags (int n): numTags (n), tagsCreationTime (0) { sessionTags = new SessionTag[numTags]; };
|
||||
~UnconfirmedTags () { delete[] sessionTags; };
|
||||
int numTags;
|
||||
SessionTag * sessionTags;
|
||||
uint32_t tagsCreationTime;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
GarlicRoutingSession (GarlicDestination * owner, const i2p::data::RoutingDestination * destination, int numTags);
|
||||
@ -50,7 +59,7 @@ namespace garlic
|
||||
~GarlicRoutingSession ();
|
||||
I2NPMessage * WrapSingleMessage (I2NPMessage * msg);
|
||||
int GetNextTag () const { return m_NextTag; };
|
||||
void TagsConfirmed (uint32_t msgID) { m_IsAcknowledged = true; };
|
||||
void TagsConfirmed (uint32_t msgID);
|
||||
|
||||
void SetLeaseSetUpdated () { m_LeaseSetUpdated = true; };
|
||||
|
||||
@ -71,7 +80,8 @@ namespace garlic
|
||||
bool m_IsAcknowledged;
|
||||
int m_NumTags, m_NextTag;
|
||||
SessionTag * m_SessionTags; // m_NumTags*32 bytes
|
||||
uint32_t m_TagsCreationTime; // seconds since epoch
|
||||
uint32_t m_TagsCreationTime; // seconds since epoch
|
||||
std::map<uint32_t, UnconfirmedTags *> m_UnconfirmedTagsMsgs;
|
||||
bool m_LeaseSetUpdated;
|
||||
|
||||
i2p::crypto::CBCEncryption m_Encryption;
|
||||
|
Loading…
Reference in New Issue
Block a user