0
0
mirror of https://github.com/PurpleI2P/i2pd synced 2025-10-05 23:52:50 +02:00

don't calculate key's base64 if not used

This commit is contained in:
orignal
2025-03-17 20:08:39 -04:00
parent bbf5c1655a
commit 609cd401bb
2 changed files with 7 additions and 3 deletions

View File

@@ -951,12 +951,13 @@ namespace data
LogPrint (eLogError, "NetDb: DatabaseLookup for zero ident. Ignored");
return;
}
auto key = i2p::data::ByteStreamToBase64 (buf, 32);
std::string key;
if (CheckLogLevel (eLogInfo))
key = i2p::data::ByteStreamToBase64 (buf, 32);
IdentHash replyIdent(buf + 32);
uint8_t flag = buf[64];
LogPrint (eLogDebug, "NetDb: DatabaseLookup for ", key, " received flags=", (int)flag);
uint8_t lookupType = flag & DATABASE_LOOKUP_TYPE_FLAGS_MASK;
const uint8_t * excluded = buf + 65;

View File

@@ -360,9 +360,12 @@ namespace data
void NetDbRequests::HandleDatabaseSearchReplyMsg (std::shared_ptr<const I2NPMessage> msg)
{
const uint8_t * buf = msg->GetPayload ();
auto key = i2p::data::ByteStreamToBase64 (buf, 32);
std::string key;
size_t num = buf[32]; // num
if (CheckLogLevel (eLogInfo))
key = i2p::data::ByteStreamToBase64 (buf, 32);
LogPrint (eLogDebug, "NetDbReq: DatabaseSearchReply for ", key, " num=", num);
IdentHash ident (buf);
bool isExploratory = false;
auto dest = FindRequest (ident);