mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
check database lookup type
This commit is contained in:
@@ -687,6 +687,9 @@ namespace data
|
|||||||
replyMsg = CreateDatabaseSearchReply (buf, routers);
|
replyMsg = CreateDatabaseSearchReply (buf, routers);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (lookupType == DATABASE_LOOKUP_TYPE_ROUTERINFO_LOOKUP ||
|
||||||
|
lookupType == DATABASE_LOOKUP_TYPE_NORMAL_LOOKUP)
|
||||||
{
|
{
|
||||||
auto router = FindRouter (buf);
|
auto router = FindRouter (buf);
|
||||||
if (router)
|
if (router)
|
||||||
@@ -696,8 +699,10 @@ namespace data
|
|||||||
if (router->GetBuffer ())
|
if (router->GetBuffer ())
|
||||||
replyMsg = CreateDatabaseStoreMsg (router);
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user