mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
try to insert received msgid instead lookup
This commit is contained in:
parent
7146a4dbae
commit
d530269e4f
|
@ -2271,23 +2271,16 @@ namespace transport
|
||||||
{
|
{
|
||||||
if (!msg) return;
|
if (!msg) return;
|
||||||
int32_t msgID = msg->GetMsgID ();
|
int32_t msgID = msg->GetMsgID ();
|
||||||
#if __cplusplus >= 202002L // C++ 20 or higher
|
if (!msg->IsExpired ())
|
||||||
if (!m_ReceivedI2NPMsgIDs.contains (msgID))
|
{
|
||||||
#else
|
// m_LastActivityTimestamp is updated in ProcessData before
|
||||||
if (!m_ReceivedI2NPMsgIDs.count (msgID))
|
if (m_ReceivedI2NPMsgIDs.emplace (msgID, (uint32_t)m_LastActivityTimestamp).second)
|
||||||
#endif
|
|
||||||
{
|
|
||||||
if (!msg->IsExpired ())
|
|
||||||
{
|
|
||||||
// m_LastActivityTimestamp is updated in ProcessData before
|
|
||||||
m_ReceivedI2NPMsgIDs.emplace (msgID, (uint32_t)m_LastActivityTimestamp);
|
|
||||||
m_Handler.PutNextMessage (std::move (msg));
|
m_Handler.PutNextMessage (std::move (msg));
|
||||||
}
|
|
||||||
else
|
else
|
||||||
LogPrint (eLogDebug, "SSU2: Message ", msgID, " expired");
|
LogPrint (eLogDebug, "SSU2: Message ", msgID, " already received");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint (eLogDebug, "SSU2: Message ", msgID, " already received");
|
LogPrint (eLogDebug, "SSU2: Message ", msgID, " expired");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SSU2Session::ExtractEndpoint (const uint8_t * buf, size_t size, boost::asio::ip::udp::endpoint& ep)
|
bool SSU2Session::ExtractEndpoint (const uint8_t * buf, size_t size, boost::asio::ip::udp::endpoint& ep)
|
||||||
|
|
Loading…
Reference in a new issue