1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-31 09:04:14 +00:00

Merge pull request #739 from majestrate/udp-tunnel-crash-fix

Udp tunnel crash fix
This commit is contained in:
orignal 2016-12-17 07:58:46 -05:00 committed by GitHub
commit ae442ee015

View File

@ -243,9 +243,6 @@ namespace datagram
if (sz) { if (sz) {
auto idx = rand() % sz; auto idx = rand() % sz;
m_CurrentRemoteLease = ls[idx]; m_CurrentRemoteLease = ls[idx];
} else {
// no more leases, bail
LogPrint(eLogWarning, "DatagramSession: no more valid remote leases to ", m_RemoteIdent.ToBase32());
} }
} else { } else {
// no remote lease set? // no remote lease set?
@ -293,6 +290,7 @@ namespace datagram
void DatagramSession::HandleLeaseSetUpdated(std::shared_ptr<i2p::data::LeaseSet> ls) void DatagramSession::HandleLeaseSetUpdated(std::shared_ptr<i2p::data::LeaseSet> ls)
{ {
if(!ls) return;
// only update lease set if found and newer than previous lease set // only update lease set if found and newer than previous lease set
uint64_t oldExpire = 0; uint64_t oldExpire = 0;
if(m_RemoteLeaseSet) oldExpire = m_RemoteLeaseSet->GetExpirationTime(); if(m_RemoteLeaseSet) oldExpire = m_RemoteLeaseSet->GetExpirationTime();