|
|
@ -828,13 +828,6 @@ namespace stream |
|
|
|
m_RTO = m_RTT*1.5; // TODO: implement it better
|
|
|
|
m_RTO = m_RTT*1.5; // TODO: implement it better
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!m_CurrentOutboundTunnel || !m_CurrentOutboundTunnel->IsEstablished ()) |
|
|
|
|
|
|
|
m_CurrentOutboundTunnel = m_LocalDestination.GetOwner ()->GetTunnelPool ()->GetNewOutboundTunnel (m_CurrentOutboundTunnel); |
|
|
|
|
|
|
|
if (!m_CurrentOutboundTunnel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "Streaming: No outbound tunnels in the pool, sSID=", m_SendStreamID); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto ts = i2p::util::GetMillisecondsSinceEpoch (); |
|
|
|
auto ts = i2p::util::GetMillisecondsSinceEpoch (); |
|
|
|
if (!m_CurrentRemoteLease || !m_CurrentRemoteLease->endDate || // excluded from LeaseSet
|
|
|
|
if (!m_CurrentRemoteLease || !m_CurrentRemoteLease->endDate || // excluded from LeaseSet
|
|
|
@ -842,6 +835,21 @@ namespace stream |
|
|
|
UpdateCurrentRemoteLease (true); |
|
|
|
UpdateCurrentRemoteLease (true); |
|
|
|
if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD) |
|
|
|
if (m_CurrentRemoteLease && ts < m_CurrentRemoteLease->endDate + i2p::data::LEASE_ENDDATE_THRESHOLD) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!m_CurrentOutboundTunnel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
auto leaseRouter = i2p::data::netdb.FindRouter (m_CurrentRemoteLease->tunnelGateway); |
|
|
|
|
|
|
|
m_CurrentOutboundTunnel = m_LocalDestination.GetOwner ()->GetTunnelPool ()->GetNextOutboundTunnel (nullptr, |
|
|
|
|
|
|
|
leaseRouter ? leaseRouter->GetCompatibleTransports (false) : (i2p::data::RouterInfo::CompatibleTransports)i2p::data::RouterInfo::eAllTransports); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (!m_CurrentOutboundTunnel->IsEstablished ()) |
|
|
|
|
|
|
|
m_CurrentOutboundTunnel = m_LocalDestination.GetOwner ()->GetTunnelPool ()->GetNewOutboundTunnel (m_CurrentOutboundTunnel); |
|
|
|
|
|
|
|
if (!m_CurrentOutboundTunnel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrint (eLogError, "Streaming: No outbound tunnels in the pool, sSID=", m_SendStreamID); |
|
|
|
|
|
|
|
m_CurrentRemoteLease = nullptr; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::vector<i2p::tunnel::TunnelMessageBlock> msgs; |
|
|
|
std::vector<i2p::tunnel::TunnelMessageBlock> msgs; |
|
|
|
for (const auto& it: packets) |
|
|
|
for (const auto& it: packets) |
|
|
|
{ |
|
|
|
{ |
|
|
|