mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
Compare commits
3 commits
29d77113cc
...
5a4ce66d42
Author | SHA1 | Date | |
---|---|---|---|
5a4ce66d42 | |||
76190ea365 | |||
f90386803f |
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -2,7 +2,7 @@ i2pd (2.54.0-1) unstable; urgency=medium
|
|||
|
||||
* updated to version 2.54.0/0.9.64
|
||||
|
||||
-- orignal <orignal@i2pmail.org> Sun, 6 Oct 2024 16:00:00 +0000
|
||||
-- orignal <orignal@i2pmail.org> Sun, 6 Oct 2024 16:00:00 +0000
|
||||
|
||||
i2pd (2.53.1-1) unstable; urgency=medium
|
||||
|
||||
|
|
|
@ -337,13 +337,14 @@ namespace transport
|
|||
SetTerminationTimeout (SSU2_TERMINATION_TIMEOUT);
|
||||
SendQueue ();
|
||||
transports.PeerConnected (shared_from_this ());
|
||||
|
||||
LogPrint(eLogDebug, "SSU2: Session with ", GetRemoteEndpoint (),
|
||||
" (", i2p::data::GetIdentHashAbbreviation (GetRemoteIdentity ()->GetIdentHash ()), ") established");
|
||||
if (m_OnEstablished)
|
||||
{
|
||||
m_OnEstablished ();
|
||||
m_OnEstablished = nullptr;
|
||||
}
|
||||
LogPrint(eLogDebug, "SSU2: Session with ", GetRemoteEndpoint (),
|
||||
" (", i2p::data::GetIdentHashAbbreviation (GetRemoteIdentity ()->GetIdentHash ()), ") established");
|
||||
}
|
||||
|
||||
void SSU2Session::Done ()
|
||||
|
@ -1944,21 +1945,28 @@ namespace transport
|
|||
void SSU2Session::HandleRelayRequest (const uint8_t * buf, size_t len)
|
||||
{
|
||||
// we are Bob
|
||||
auto mts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
uint32_t nonce = bufbe32toh (buf + 1); // nonce
|
||||
uint32_t relayTag = bufbe32toh (buf + 5); // relay tag
|
||||
auto session = m_Server.FindRelaySession (relayTag);
|
||||
if (!session)
|
||||
{
|
||||
LogPrint (eLogWarning, "SSU2: RelayRequest session with relay tag ", relayTag, " not found");
|
||||
// send relay response back to Alice
|
||||
uint8_t payload[SSU2_MAX_PACKET_SIZE];
|
||||
size_t payloadSize = CreateRelayResponseBlock (payload, m_MaxPayloadSize,
|
||||
eSSU2RelayResponseCodeBobRelayTagNotFound, bufbe32toh (buf + 1), 0, false);
|
||||
payloadSize += CreatePaddingBlock (payload + payloadSize, m_MaxPayloadSize - payloadSize);
|
||||
SendData (payload, payloadSize);
|
||||
auto packet = m_Server.GetSentPacketsPool ().AcquireShared ();
|
||||
packet->payloadSize = CreateAckBlock (packet->payload, m_MaxPayloadSize);
|
||||
packet->payloadSize += CreateRelayResponseBlock (packet->payload + packet->payloadSize, m_MaxPayloadSize - packet->payloadSize,
|
||||
eSSU2RelayResponseCodeBobRelayTagNotFound, nonce, 0, false);
|
||||
packet->payloadSize += CreatePaddingBlock (packet->payload + packet->payloadSize, m_MaxPayloadSize - packet->payloadSize);
|
||||
uint32_t packetNum = SendData (packet->payload, packet->payloadSize);
|
||||
if (m_RemoteVersion >= SSU2_MIN_RELAY_RESPONSE_RESEND_VERSION)
|
||||
{
|
||||
// sometimes Alice doesn't ack this RelayResponse in older versions
|
||||
packet->sendTime = mts;
|
||||
m_SentPackets.emplace (packetNum, packet);
|
||||
}
|
||||
return;
|
||||
}
|
||||
auto mts = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
uint32_t nonce = bufbe32toh (buf + 1);
|
||||
if (session->m_RelaySessions.emplace (nonce, std::make_pair (shared_from_this (), mts/1000)).second)
|
||||
{
|
||||
// send relay intro to Charlie
|
||||
|
|
Loading…
Reference in a new issue