|
|
|
@ -83,9 +83,9 @@ namespace transport
@@ -83,9 +83,9 @@ namespace transport
|
|
|
|
|
TransportSession (in_RemoteRouter, SSU2_CONNECT_TIMEOUT), |
|
|
|
|
m_Server (server), m_Address (addr), m_RemoteTransports (0), |
|
|
|
|
m_DestConnID (0), m_SourceConnID (0), m_State (eSSU2SessionStateUnknown), |
|
|
|
|
m_SendPacketNum (0), m_ReceivePacketNum (0), m_IsDataReceived (false), |
|
|
|
|
m_WindowSize (SSU2_MIN_WINDOW_SIZE), m_RTT (SSU2_RESEND_INTERVAL), |
|
|
|
|
m_RTO (SSU2_RESEND_INTERVAL*SSU2_kAPPA), m_RelayTag (0), |
|
|
|
|
m_SendPacketNum (0), m_ReceivePacketNum (0), m_LastDatetimeSentPacketNum (0), |
|
|
|
|
m_IsDataReceived (false), m_WindowSize (SSU2_MIN_WINDOW_SIZE), |
|
|
|
|
m_RTT (SSU2_RESEND_INTERVAL), m_RTO (SSU2_RESEND_INTERVAL*SSU2_kAPPA), 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
|
|
|
|
|
{ |
|
|
|
@ -2806,7 +2806,16 @@ namespace transport
@@ -2806,7 +2806,16 @@ namespace transport
|
|
|
|
|
void SSU2Session::SendQuickAck () |
|
|
|
|
{ |
|
|
|
|
uint8_t payload[SSU2_MAX_PACKET_SIZE]; |
|
|
|
|
size_t payloadSize = CreateAckBlock (payload, m_MaxPayloadSize); |
|
|
|
|
size_t payloadSize = 0; |
|
|
|
|
if (m_SendPacketNum > m_LastDatetimeSentPacketNum + SSU2_SEND_DATETIME_NUM_PACKETS) |
|
|
|
|
{ |
|
|
|
|
payload[0] = eSSU2BlkDateTime; |
|
|
|
|
htobe16buf (payload + 1, 4); |
|
|
|
|
htobe32buf (payload + 3, (i2p::util::GetMillisecondsSinceEpoch () + 500)/1000); |
|
|
|
|
payloadSize += 7; |
|
|
|
|
m_LastDatetimeSentPacketNum = m_SendPacketNum; |
|
|
|
|
} |
|
|
|
|
payloadSize += CreateAckBlock (payload + payloadSize, m_MaxPayloadSize - payloadSize); |
|
|
|
|
payloadSize += CreatePaddingBlock (payload + payloadSize, m_MaxPayloadSize - payloadSize); |
|
|
|
|
SendData (payload, payloadSize); |
|
|
|
|
} |
|
|
|
|