|
|
@ -343,17 +343,22 @@ namespace client
|
|
|
|
if (m_Session)
|
|
|
|
if (m_Session)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
i2p::data::IdentityEx dest;
|
|
|
|
i2p::data::IdentityEx dest;
|
|
|
|
dest.FromBase64 (destination);
|
|
|
|
size_t len = dest.FromBase64(destination);
|
|
|
|
context.GetAddressBook ().InsertAddress (dest);
|
|
|
|
if (len > 0)
|
|
|
|
auto leaseSet = m_Session->localDestination->FindLeaseSet (dest.GetIdentHash ());
|
|
|
|
{
|
|
|
|
|
|
|
|
context.GetAddressBook().InsertAddress(dest);
|
|
|
|
|
|
|
|
auto leaseSet = m_Session->localDestination->FindLeaseSet(dest.GetIdentHash());
|
|
|
|
if (leaseSet)
|
|
|
|
if (leaseSet)
|
|
|
|
Connect (leaseSet);
|
|
|
|
Connect(leaseSet);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_Session->localDestination->RequestDestination (dest.GetIdentHash (),
|
|
|
|
m_Session->localDestination->RequestDestination(dest.GetIdentHash(),
|
|
|
|
std::bind (&SAMSocket::HandleConnectLeaseSetRequestComplete,
|
|
|
|
std::bind(&SAMSocket::HandleConnectLeaseSetRequestComplete,
|
|
|
|
shared_from_this (), std::placeholders::_1));
|
|
|
|
shared_from_this(), std::placeholders::_1));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
SendMessageReply(SAM_SESSION_STATUS_INVALID_KEY, strlen(SAM_SESSION_STATUS_INVALID_KEY), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
|
|
|
SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true);
|
|
|
|