mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
handle I2NP message block
This commit is contained in:
parent
53148fe58f
commit
7e7aee27b6
@ -600,7 +600,15 @@ namespace transport
|
||||
break;
|
||||
}
|
||||
case eSSU2BlkI2NPMessage:
|
||||
break;
|
||||
{
|
||||
LogPrint (eLogDebug, "SSU2: I2NP message");
|
||||
auto nextMsg = NewI2NPShortMessage ();
|
||||
nextMsg->len = nextMsg->offset + size + 7; // 7 more bytes for full I2NP header
|
||||
memcpy (nextMsg->GetNTCP2Header (), buf + offset, size);
|
||||
nextMsg->FromNTCP2 (); // SSU2 has the same format as NTCP2
|
||||
m_Handler.PutNextMessage (std::move (nextMsg));
|
||||
break;
|
||||
}
|
||||
case eSSU2BlkFirstFragment:
|
||||
break;
|
||||
case eSSU2BlkFollowOnFragment:
|
||||
@ -654,6 +662,7 @@ namespace transport
|
||||
}
|
||||
offset += size;
|
||||
}
|
||||
m_Handler.Flush ();
|
||||
}
|
||||
|
||||
bool SSU2Session::ExtractEndpoint (const uint8_t * buf, size_t size, boost::asio::ip::udp::endpoint& ep)
|
||||
|
@ -148,6 +148,7 @@ namespace transport
|
||||
SSU2SessionState m_State;
|
||||
uint8_t m_KeyDataSend[64], m_KeyDataReceive[64];
|
||||
uint32_t m_SendPacketNum, m_ReceivePacketNum;
|
||||
i2p::I2NPMessagesHandler m_Handler;
|
||||
};
|
||||
|
||||
class SSU2Server: private i2p::util::RunnableServiceWithWork
|
||||
|
Loading…
Reference in New Issue
Block a user