0
0
mirror of https://github.com/PurpleI2P/i2pd synced 2025-10-05 23:52:50 +02:00

send options with datagram3 only

This commit is contained in:
orignal
2025-10-02 21:16:54 -04:00
parent ba2cfe58bc
commit fd012fa3b7

View File

@@ -164,6 +164,8 @@ namespace client
auto ts = i2p::util::GetMillisecondsSinceEpoch();
auto session = GetDatagramSession ();
if (ts > LastActivity + I2P_UDP_REPLIABLE_DATAGRAM_INTERVAL)
{
if (session->GetVersion () == i2p::datagram::eDatagramV3)
{
i2p::util::Mapping options;
options.Put (UDP_SESSION_SEQN, m_NextSendPacketNum);
@@ -171,6 +173,9 @@ namespace client
options.Put (UDP_SESSION_ACKED, m_LastReceivedPacketNum);
m_Destination->SendDatagram(session, m_Buffer, len, LocalPort, RemotePort, &options);
}
else
m_Destination->SendDatagram(session, m_Buffer, len, LocalPort, RemotePort);
}
else
m_Destination->SendRawDatagram(session, m_Buffer, len, LocalPort, RemotePort);
size_t numPackets = 0;
@@ -373,6 +378,8 @@ namespace client
LogPrint (eLogDebug, "UDP Client: Send ", transferred, " to ", m_RemoteAddr->identHash.ToBase32 (), ":", RemotePort);
auto session = GetDatagramSession ();
if (ts > m_LastSession->second + I2P_UDP_REPLIABLE_DATAGRAM_INTERVAL)
{
if (m_DatagramVersion == i2p::datagram::eDatagramV3)
{
i2p::util::Mapping options;
options.Put (UDP_SESSION_SEQN, m_NextSendPacketNum);
@@ -380,6 +387,9 @@ namespace client
options.Put (UDP_SESSION_ACKED, m_LastReceivedPacketNum);
m_LocalDest->GetDatagramDestination ()->SendDatagram (session, m_RecvBuff, transferred, remotePort, RemotePort, &options);
}
else
m_LocalDest->GetDatagramDestination ()->SendDatagram (session, m_RecvBuff, transferred, remotePort, RemotePort);
}
else
m_LocalDest->GetDatagramDestination ()->SendRawDatagram (session, m_RecvBuff, transferred, remotePort, RemotePort);
size_t numPackets = 0;