mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
check database lookup type
This commit is contained in:
parent
128a8f3b48
commit
562de3514a
24
NetDb.cpp
24
NetDb.cpp
@ -688,16 +688,21 @@ namespace data
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto router = FindRouter (buf);
|
if (lookupType == DATABASE_LOOKUP_TYPE_ROUTERINFO_LOOKUP ||
|
||||||
if (router)
|
lookupType == DATABASE_LOOKUP_TYPE_NORMAL_LOOKUP)
|
||||||
{
|
{
|
||||||
LogPrint ("Requested RouterInfo ", key, " found");
|
auto router = FindRouter (buf);
|
||||||
router->LoadBuffer ();
|
if (router)
|
||||||
if (router->GetBuffer ())
|
{
|
||||||
replyMsg = CreateDatabaseStoreMsg (router);
|
LogPrint ("Requested RouterInfo ", key, " found");
|
||||||
|
router->LoadBuffer ();
|
||||||
|
if (router->GetBuffer ())
|
||||||
|
replyMsg = CreateDatabaseStoreMsg (router);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!replyMsg)
|
if (!replyMsg && (lookupType == DATABASE_LOOKUP_TYPE_LEASESET_LOOKUP ||
|
||||||
|
lookupType == DATABASE_LOOKUP_TYPE_NORMAL_LOOKUP))
|
||||||
{
|
{
|
||||||
auto leaseSet = FindLeaseSet (buf);
|
auto leaseSet = FindLeaseSet (buf);
|
||||||
if (leaseSet) // we don't send back our LeaseSets
|
if (leaseSet) // we don't send back our LeaseSets
|
||||||
@ -706,6 +711,7 @@ namespace data
|
|||||||
replyMsg = CreateDatabaseStoreMsg (leaseSet);
|
replyMsg = CreateDatabaseStoreMsg (leaseSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!replyMsg)
|
if (!replyMsg)
|
||||||
{
|
{
|
||||||
LogPrint ("Requested ", key, " not found. ", numExcluded, " excluded");
|
LogPrint ("Requested ", key, " not found. ", numExcluded, " excluded");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user