mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
exploratory improvement
This commit is contained in:
parent
49c57db6b7
commit
e7126908f9
@ -463,9 +463,11 @@ namespace i2p
|
|||||||
msg->offset += sizeof (I2NPHeader) + sizeof (TunnelGatewayHeader);
|
msg->offset += sizeof (I2NPHeader) + sizeof (TunnelGatewayHeader);
|
||||||
msg->len = msg->offset + len;
|
msg->len = msg->offset + len;
|
||||||
LogPrint ("TunnelGateway of ", (int)len, " bytes for tunnel ", (unsigned int)tunnelID, ". Msg type ", (int)msg->GetHeader()->typeID);
|
LogPrint ("TunnelGateway of ", (int)len, " bytes for tunnel ", (unsigned int)tunnelID, ". Msg type ", (int)msg->GetHeader()->typeID);
|
||||||
if (msg->GetHeader()->typeID == eI2NPDatabaseStore)
|
if (msg->GetHeader()->typeID == eI2NPDatabaseStore ||
|
||||||
|
msg->GetHeader()->typeID == eI2NPDatabaseSearchReply)
|
||||||
{
|
{
|
||||||
// transit DatabaseStore my contain new/updated RI
|
// transit DatabaseStore my contain new/updated RI
|
||||||
|
// or DatabaseSearchReply with new routers
|
||||||
auto ds = NewI2NPMessage ();
|
auto ds = NewI2NPMessage ();
|
||||||
*ds = *msg;
|
*ds = *msg;
|
||||||
i2p::data::netdb.PostI2NPMsg (ds);
|
i2p::data::netdb.PostI2NPMsg (ds);
|
||||||
|
12
NetDb.cpp
12
NetDb.cpp
@ -559,7 +559,19 @@ namespace data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
LogPrint ("Requested destination for ", key, " not found");
|
LogPrint ("Requested destination for ", key, " not found");
|
||||||
|
// it might contain new routers
|
||||||
|
for (int i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
IdentHash router (buf + 33 + i*32);
|
||||||
|
if (!FindRouter (router))
|
||||||
|
{
|
||||||
|
LogPrint ("New router ", router.ToBase64 (), " found. Request it");
|
||||||
|
RequestDestination (router);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
i2p::DeleteI2NPMessage (msg);
|
i2p::DeleteI2NPMessage (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,9 +203,10 @@ namespace tunnel
|
|||||||
// to somebody else
|
// to somebody else
|
||||||
if (!m_IsInbound) // outbound transit tunnel
|
if (!m_IsInbound) // outbound transit tunnel
|
||||||
{
|
{
|
||||||
if (msg.data->GetHeader()->typeID == eI2NPDatabaseStore)
|
if (msg.data->GetHeader()->typeID == eI2NPDatabaseStore ||
|
||||||
|
msg.data->GetHeader()->typeID == eI2NPDatabaseSearchReply )
|
||||||
{
|
{
|
||||||
// catch RI
|
// catch RI or reply with new list of routers
|
||||||
auto ds = NewI2NPMessage ();
|
auto ds = NewI2NPMessage ();
|
||||||
*ds = *(msg.data);
|
*ds = *(msg.data);
|
||||||
i2p::data::netdb.PostI2NPMsg (ds);
|
i2p::data::netdb.PostI2NPMsg (ds);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user