mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
set minimal resend interval. Resend attempt after only Ack
This commit is contained in:
parent
0c924836cf
commit
11328a429d
2 changed files with 7 additions and 2 deletions
|
@ -91,7 +91,7 @@ namespace transport
|
|||
m_RTO (SSU2_INITIAL_RTO), m_RelayTag (0),m_ConnectTimer (server.GetService ()),
|
||||
m_TerminationReason (eSSU2TerminationReasonNormalClose),
|
||||
m_MaxPayloadSize (SSU2_MIN_PACKET_SIZE - IPV6_HEADER_SIZE - UDP_HEADER_SIZE - 32), // min size
|
||||
m_LastResendTime (0)
|
||||
m_LastResendTime (0), m_LastResendAttemptTime (0)
|
||||
{
|
||||
m_NoiseState.reset (new i2p::crypto::NoiseSymmetricState);
|
||||
if (in_RemoteRouter && m_Address)
|
||||
|
@ -548,6 +548,8 @@ namespace transport
|
|||
|
||||
size_t SSU2Session::Resend (uint64_t ts)
|
||||
{
|
||||
if (ts + SSU2_RESEND_ATTEMPT_MIN_INTERVAL < m_LastResendAttemptTime) return 0;
|
||||
m_LastResendAttemptTime = ts;
|
||||
// resend handshake packet
|
||||
if (m_SentHandshakePacket && ts >= m_SentHandshakePacket->sendTime + SSU2_HANDSHAKE_RESEND_INTERVAL)
|
||||
{
|
||||
|
@ -3131,6 +3133,8 @@ namespace transport
|
|||
m_Handler.Flush ();
|
||||
m_IsDataReceived = false;
|
||||
}
|
||||
else if (!sent && !m_SentPackets.empty ()) // if only acks received, nothing sent and we still have something to resend
|
||||
Resend (i2p::util::GetMillisecondsSinceEpoch ()); // than right time to resend
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue