mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
remember tunnels selection for following messages
This commit is contained in:
parent
1da5be2871
commit
9b6c229b71
3 changed files with 49 additions and 11 deletions
15
Garlic.cpp
15
Garlic.cpp
|
@ -125,6 +125,14 @@ namespace garlic
|
|||
else
|
||||
it++;
|
||||
}
|
||||
CleanupUnconfirmedTags ();
|
||||
return !m_SessionTags.empty () || !m_UnconfirmedTagsMsgs.empty ();
|
||||
}
|
||||
|
||||
bool GarlicRoutingSession::CleanupUnconfirmedTags ()
|
||||
{
|
||||
bool ret = false;
|
||||
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
// delete expired unconfirmed tags
|
||||
for (auto it = m_UnconfirmedTagsMsgs.begin (); it != m_UnconfirmedTagsMsgs.end ();)
|
||||
{
|
||||
|
@ -133,12 +141,13 @@ namespace garlic
|
|||
if (m_Owner)
|
||||
m_Owner->RemoveDeliveryStatusSession ((*it)->msgID);
|
||||
it = m_UnconfirmedTagsMsgs.erase (it);
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
it++;
|
||||
}
|
||||
return !m_SessionTags.empty () || !m_UnconfirmedTagsMsgs.empty ();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::shared_ptr<I2NPMessage> GarlicRoutingSession::WrapSingleMessage (std::shared_ptr<const I2NPMessage> msg)
|
||||
{
|
||||
|
@ -625,7 +634,7 @@ namespace garlic
|
|||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GarlicDestination::RemoveDeliveryStatusSession (uint32_t msgID)
|
||||
{
|
||||
m_DeliveryStatusSessions.erase (msgID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue