mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
lookup for b33 address
This commit is contained in:
parent
f1c24689bf
commit
079798940b
@ -617,15 +617,22 @@ namespace client
|
||||
SendNamingLookupReply (dest->GetIdentity ());
|
||||
else if ((identity = context.GetAddressBook ().GetFullAddress (name)) != nullptr)
|
||||
SendNamingLookupReply (identity);
|
||||
else if ((addr = context.GetAddressBook ().GetAddress (name)) && addr->IsIdentHash ())
|
||||
else if ((addr = context.GetAddressBook ().GetAddress (name)))
|
||||
{
|
||||
auto leaseSet = dest->FindLeaseSet (addr->identHash);
|
||||
if (leaseSet)
|
||||
SendNamingLookupReply (leaseSet->GetIdentity ());
|
||||
if (addr->IsIdentHash ())
|
||||
{
|
||||
auto leaseSet = dest->FindLeaseSet (addr->identHash);
|
||||
if (leaseSet)
|
||||
SendNamingLookupReply (leaseSet->GetIdentity ());
|
||||
else
|
||||
dest->RequestDestination (addr->identHash,
|
||||
std::bind (&SAMSocket::HandleNamingLookupLeaseSetRequestComplete,
|
||||
shared_from_this (), std::placeholders::_1, name));
|
||||
}
|
||||
else
|
||||
dest->RequestDestination (addr->identHash,
|
||||
dest->RequestDestinationWithEncryptedLeaseSet (addr->blindedPublicKey,
|
||||
std::bind (&SAMSocket::HandleNamingLookupLeaseSetRequestComplete,
|
||||
shared_from_this (), std::placeholders::_1, addr->identHash));
|
||||
shared_from_this (), std::placeholders::_1, name));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -650,7 +657,7 @@ namespace client
|
||||
SendMessageReply (m_Buffer, len, true);
|
||||
}
|
||||
|
||||
void SAMSocket::HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, i2p::data::IdentHash ident)
|
||||
void SAMSocket::HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, std::string name)
|
||||
{
|
||||
if (leaseSet)
|
||||
{
|
||||
@ -659,13 +666,11 @@ namespace client
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "SAM: naming lookup failed. LeaseSet for ", ident.ToBase32 (), " not found");
|
||||
LogPrint (eLogError, "SAM: naming lookup failed. LeaseSet for ", name, " not found");
|
||||
#ifdef _MSC_VER
|
||||
size_t len = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY,
|
||||
context.GetAddressBook ().ToAddress (ident).c_str());
|
||||
size_t len = sprintf_s (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, name.c_str());
|
||||
#else
|
||||
size_t len = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY,
|
||||
context.GetAddressBook ().ToAddress (ident).c_str());
|
||||
size_t len = snprintf (m_Buffer, SAM_SOCKET_BUFFER_SIZE, SAM_NAMING_REPLY_INVALID_KEY, name.c_str());
|
||||
#endif
|
||||
SendMessageReply (m_Buffer, len, false);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace client
|
||||
void Connect (std::shared_ptr<const i2p::data::LeaseSet> remote);
|
||||
void HandleConnectLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet);
|
||||
void SendNamingLookupReply (std::shared_ptr<const i2p::data::IdentityEx> identity);
|
||||
void HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, i2p::data::IdentHash ident);
|
||||
void HandleNamingLookupLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, std::string name);
|
||||
void HandleSessionReadinessCheckTimer (const boost::system::error_code& ecode);
|
||||
void SendSessionCreateReplyOk ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user