handle LeaseSet expiration correctly

This commit is contained in:
orignal 2016-02-14 18:30:07 -05:00
parent 49b1e76585
commit ca56d3fc23
3 changed files with 14 additions and 12 deletions

View file

@ -731,8 +731,7 @@ namespace stream
{
if (!m_RemoteLeaseSet || m_RemoteLeaseSet->IsExpired ())
{
auto remoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
if (remoteLeaseSet) m_RemoteLeaseSet = remoteLeaseSet; // renew if possible
m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
if (!m_RemoteLeaseSet)
LogPrint (eLogWarning, "Streaming: LeaseSet ", m_RemoteIdentity->GetIdentHash ().ToBase64 (), " not found");
}
@ -774,6 +773,7 @@ namespace stream
m_RemoteLeaseSet = nullptr;
m_CurrentRemoteLease = nullptr;
// re-request expired
m_LocalDestination.GetOwner ()->RequestDestination (m_RemoteIdentity->GetIdentHash ());
}
}
else