mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
publish and request through exploratory tunnel if floodfill is not reachable
This commit is contained in:
parent
2d0e219197
commit
313921da56
3 changed files with 31 additions and 7 deletions
|
@ -244,7 +244,8 @@ namespace i2p
|
|||
return m;
|
||||
}
|
||||
|
||||
std::shared_ptr<I2NPMessage> CreateDatabaseStoreMsg (std::shared_ptr<const i2p::data::RouterInfo> router, uint32_t replyToken)
|
||||
std::shared_ptr<I2NPMessage> CreateDatabaseStoreMsg (std::shared_ptr<const i2p::data::RouterInfo> router,
|
||||
uint32_t replyToken, std::shared_ptr<const i2p::tunnel::InboundTunnel> replyTunnel)
|
||||
{
|
||||
if (!router) // we send own RouterInfo
|
||||
router = context.GetSharedRouterInfo ();
|
||||
|
@ -258,10 +259,20 @@ namespace i2p
|
|||
uint8_t * buf = payload + DATABASE_STORE_HEADER_SIZE;
|
||||
if (replyToken)
|
||||
{
|
||||
memset (buf, 0, 4); // zero tunnelID means direct reply
|
||||
buf += 4;
|
||||
memcpy (buf, router->GetIdentHash (), 32);
|
||||
buf += 32;
|
||||
if (replyTunnel)
|
||||
{
|
||||
htobe32buf (buf, replyTunnel->GetNextTunnelID ());
|
||||
buf += 4; // reply tunnelID
|
||||
memcpy (buf, replyTunnel->GetNextIdentHash (), 32);
|
||||
buf += 32; // reply tunnel gateway
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (buf, 0, 4); // zero tunnelID means direct reply
|
||||
buf += 4;
|
||||
memcpy (buf, context.GetIdentHash (), 32);
|
||||
buf += 32;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t * sizePtr = buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue