mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-29 05:28:54 +00:00
refresh remote leaseset on udp ack timeout
This commit is contained in:
@@ -747,6 +747,15 @@ namespace datagram
|
||||
if(ls && ls->GetExpirationTime() > oldExpire) m_RemoteLeaseSet = ls;
|
||||
}
|
||||
|
||||
void DatagramSession::RequestUpdatedLeaseSet ()
|
||||
{
|
||||
if (!m_RequestingLS)
|
||||
{
|
||||
m_RequestingLS = true;
|
||||
m_LocalDestination->RequestDestination(m_RemoteIdent, std::bind(&DatagramSession::HandleLeaseSetUpdated, this, std::placeholders::_1));
|
||||
}
|
||||
}
|
||||
|
||||
void DatagramSession::FlushSendQueue ()
|
||||
{
|
||||
if (m_SendQueue.empty ()) return;
|
||||
|
||||
@@ -85,6 +85,8 @@ namespace datagram
|
||||
void SetVersion (DatagramVersion version) { m_Version = version; }
|
||||
|
||||
void DropSharedRoutingPath () { if (m_RoutingSession) m_RoutingSession->SetSharedRoutingPath (nullptr); }
|
||||
// request LeaseSet update from floodfill in case our copy contains dead leases
|
||||
void RequestUpdatedLeaseSet ();
|
||||
|
||||
struct Info
|
||||
{
|
||||
|
||||
@@ -216,6 +216,7 @@ namespace client
|
||||
if (session)
|
||||
{
|
||||
session->DropSharedRoutingPath ();
|
||||
session->RequestUpdatedLeaseSet (); // in case current leases are dead
|
||||
m_Destination->SendDatagram (session, nullptr, 0, 0, 0, &options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user