mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-23 17:36:37 +02:00
don't copy transit DatabaseStore
This commit is contained in:
parent
bf4c33325c
commit
047c6a93a3
2 changed files with 2 additions and 10 deletions
|
@ -440,13 +440,9 @@ namespace tunnel
|
||||||
LogPrint (eLogDebug, "TunnelGateway of ", (int)len, " bytes for tunnel ", tunnel->GetTunnelID (), ". Msg type ", (int)typeID);
|
LogPrint (eLogDebug, "TunnelGateway of ", (int)len, " bytes for tunnel ", tunnel->GetTunnelID (), ". Msg type ", (int)typeID);
|
||||||
|
|
||||||
if (typeID == eI2NPDatabaseStore || typeID == eI2NPDatabaseSearchReply)
|
if (typeID == eI2NPDatabaseStore || typeID == eI2NPDatabaseSearchReply)
|
||||||
{
|
|
||||||
// transit DatabaseStore my contain new/updated RI
|
// transit DatabaseStore my contain new/updated RI
|
||||||
// or DatabaseSearchReply with new routers
|
// or DatabaseSearchReply with new routers
|
||||||
auto ds = NewI2NPMessage ();
|
i2p::data::netdb.PostI2NPMsg (msg);
|
||||||
*ds = *msg; // TODO: don't copy once msg is shared_ptr
|
|
||||||
i2p::data::netdb.PostI2NPMsg (ToSharedI2NPMessage (ds));
|
|
||||||
}
|
|
||||||
tunnel->SendTunnelDataMsg (msg);
|
tunnel->SendTunnelDataMsg (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,12 +243,8 @@ namespace tunnel
|
||||||
{
|
{
|
||||||
auto typeID = msg.data->GetTypeID ();
|
auto typeID = msg.data->GetTypeID ();
|
||||||
if (typeID == eI2NPDatabaseStore || typeID == eI2NPDatabaseSearchReply )
|
if (typeID == eI2NPDatabaseStore || typeID == eI2NPDatabaseSearchReply )
|
||||||
{
|
|
||||||
// catch RI or reply with new list of routers
|
// catch RI or reply with new list of routers
|
||||||
auto ds = NewI2NPShortMessage ();
|
i2p::data::netdb.PostI2NPMsg (msg.data);
|
||||||
*ds = *(msg.data); // TODO: don't copy once msg.data is shared_ptr
|
|
||||||
i2p::data::netdb.PostI2NPMsg (ToSharedI2NPMessage (ds));
|
|
||||||
}
|
|
||||||
i2p::transport::transports.SendMessage (msg.hash, msg.data);
|
i2p::transport::transports.SendMessage (msg.hash, msg.data);
|
||||||
}
|
}
|
||||||
else // we shouldn't send this message. possible leakage
|
else // we shouldn't send this message. possible leakage
|
||||||
|
|
Loading…
Add table
Reference in a new issue