mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
don't reply to DatabaseStore messages extracted from transit
This commit is contained in:
parent
5769a41208
commit
c34df2090c
|
@ -586,10 +586,16 @@ namespace tunnel
|
||||||
auto typeID = msg->GetTypeID ();
|
auto typeID = msg->GetTypeID ();
|
||||||
LogPrint (eLogDebug, "Tunnel: Gateway of ", (int) len, " bytes for tunnel ", tunnel->GetTunnelID (), ", msg type ", (int)typeID);
|
LogPrint (eLogDebug, "Tunnel: Gateway of ", (int) len, " bytes for tunnel ", tunnel->GetTunnelID (), ", msg type ", (int)typeID);
|
||||||
|
|
||||||
if (IsRouterInfoMsg (msg) || typeID == eI2NPDatabaseSearchReply)
|
if (typeID == eI2NPDatabaseSearchReply)
|
||||||
// transit DatabaseStore my contain new/updated RI
|
// DatabaseSearchReply with new routers
|
||||||
// or DatabaseSearchReply with new routers
|
|
||||||
i2p::data::netdb.PostI2NPMsg (CopyI2NPMessage (msg));
|
i2p::data::netdb.PostI2NPMsg (CopyI2NPMessage (msg));
|
||||||
|
else if (IsRouterInfoMsg (msg))
|
||||||
|
{
|
||||||
|
// transit DatabaseStore might contain new/updated RI
|
||||||
|
auto m = CopyI2NPMessage (msg);
|
||||||
|
memset (m->GetPayload () + DATABASE_STORE_REPLY_TOKEN_OFFSET, 0, 4); // no reply
|
||||||
|
i2p::data::netdb.PostI2NPMsg (m);
|
||||||
|
}
|
||||||
tunnel->SendTunnelDataMsg (msg);
|
tunnel->SendTunnelDataMsg (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -324,9 +324,17 @@ namespace tunnel
|
||||||
uint8_t typeID = msg.data->GetTypeID ();
|
uint8_t typeID = msg.data->GetTypeID ();
|
||||||
LogPrint (eLogDebug, "TunnelMessage: Handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);
|
LogPrint (eLogDebug, "TunnelMessage: Handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);
|
||||||
// catch RI or reply with new list of routers
|
// catch RI or reply with new list of routers
|
||||||
if ((IsRouterInfoMsg (msg.data) || typeID == eI2NPDatabaseSearchReply) &&
|
if (!m_IsInbound && msg.deliveryType != eDeliveryTypeLocal)
|
||||||
!m_IsInbound && msg.deliveryType != eDeliveryTypeLocal)
|
{
|
||||||
i2p::data::netdb.PostI2NPMsg (CopyI2NPMessage (msg.data));
|
if (typeID == eI2NPDatabaseSearchReply)
|
||||||
|
i2p::data::netdb.PostI2NPMsg (CopyI2NPMessage (msg.data));
|
||||||
|
else if (IsRouterInfoMsg (msg.data))
|
||||||
|
{
|
||||||
|
auto m = CopyI2NPMessage (msg.data);
|
||||||
|
memset (m->GetPayload () + DATABASE_STORE_REPLY_TOKEN_OFFSET, 0, 4); // no reply
|
||||||
|
i2p::data::netdb.PostI2NPMsg (m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (msg.deliveryType)
|
switch (msg.deliveryType)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue