mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
shared RTT
This commit is contained in:
parent
517385fb63
commit
333103f50e
@ -462,8 +462,7 @@ namespace client
|
|||||||
// we got latest LeasetSet
|
// we got latest LeasetSet
|
||||||
LogPrint (eLogDebug, "Destination: published LeaseSet verified");
|
LogPrint (eLogDebug, "Destination: published LeaseSet verified");
|
||||||
s->m_PublishVerificationTimer.expires_from_now (boost::posix_time::seconds(PUBLISH_REGULAR_VERIFICATION_INTERNAL));
|
s->m_PublishVerificationTimer.expires_from_now (boost::posix_time::seconds(PUBLISH_REGULAR_VERIFICATION_INTERNAL));
|
||||||
s->m_PublishVerificationTimer.async_wait (std::bind (&ClientDestination::HandlePublishVerificationTimer,
|
s->m_PublishVerificationTimer.async_wait (std::bind (&ClientDestination::HandlePublishVerificationTimer, s, std::placeholders::_1));
|
||||||
s, std::placeholders::_1));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
Garlic.h
1
Garlic.h
@ -62,6 +62,7 @@ namespace garlic
|
|||||||
{
|
{
|
||||||
std::shared_ptr<i2p::tunnel::OutboundTunnel> outboundTunnel;
|
std::shared_ptr<i2p::tunnel::OutboundTunnel> outboundTunnel;
|
||||||
std::shared_ptr<const i2p::data::Lease> remoteLease;
|
std::shared_ptr<const i2p::data::Lease> remoteLease;
|
||||||
|
int rtt; // RTT
|
||||||
uint32_t updateTime; // seconds since epoch
|
uint32_t updateTime; // seconds since epoch
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ namespace stream
|
|||||||
if (!seqn && m_RoutingSession) // first message confirmed
|
if (!seqn && m_RoutingSession) // first message confirmed
|
||||||
m_RoutingSession->SetSharedRoutingPath (
|
m_RoutingSession->SetSharedRoutingPath (
|
||||||
std::make_shared<i2p::garlic::GarlicRoutingPath> (
|
std::make_shared<i2p::garlic::GarlicRoutingPath> (
|
||||||
i2p::garlic::GarlicRoutingPath{m_CurrentOutboundTunnel, m_CurrentRemoteLease, 0}));
|
i2p::garlic::GarlicRoutingPath{m_CurrentOutboundTunnel, m_CurrentRemoteLease, m_RTT, 0}));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -605,6 +605,8 @@ namespace stream
|
|||||||
{
|
{
|
||||||
m_CurrentOutboundTunnel = routingPath->outboundTunnel;
|
m_CurrentOutboundTunnel = routingPath->outboundTunnel;
|
||||||
m_CurrentRemoteLease = routingPath->remoteLease;
|
m_CurrentRemoteLease = routingPath->remoteLease;
|
||||||
|
m_RTT = routingPath->rtt;
|
||||||
|
m_RTO = m_RTT*1.5; // TODO: implement it better
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -727,7 +729,8 @@ namespace stream
|
|||||||
{
|
{
|
||||||
if (!m_RemoteLeaseSet || m_RemoteLeaseSet->IsExpired ())
|
if (!m_RemoteLeaseSet || m_RemoteLeaseSet->IsExpired ())
|
||||||
{
|
{
|
||||||
m_RemoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
|
auto remoteLeaseSet = m_LocalDestination.GetOwner ()->FindLeaseSet (m_RemoteIdentity->GetIdentHash ());
|
||||||
|
if (remoteLeaseSet) m_RemoteLeaseSet = remoteLeaseSet; // renew if possible
|
||||||
if (!m_RemoteLeaseSet)
|
if (!m_RemoteLeaseSet)
|
||||||
LogPrint (eLogWarning, "Streaming: LeaseSet ", m_RemoteIdentity->GetIdentHash ().ToBase64 (), " not found");
|
LogPrint (eLogWarning, "Streaming: LeaseSet ", m_RemoteIdentity->GetIdentHash ().ToBase64 (), " not found");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user