mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-19 01:09:58 +00:00
reply with CANT_REACH_PEER if connect to outselves
This commit is contained in:
parent
dfe8b25e5e
commit
cd087568b5
@ -523,15 +523,20 @@ namespace client
|
|||||||
{
|
{
|
||||||
if (addr->IsIdentHash ())
|
if (addr->IsIdentHash ())
|
||||||
{
|
{
|
||||||
auto leaseSet = session->GetLocalDestination ()->FindLeaseSet(addr->identHash);
|
if (session->GetLocalDestination ()->GetIdentHash () != addr->identHash)
|
||||||
if (leaseSet)
|
{
|
||||||
Connect(leaseSet, session);
|
auto leaseSet = session->GetLocalDestination ()->FindLeaseSet(addr->identHash);
|
||||||
else
|
if (leaseSet)
|
||||||
{
|
Connect(leaseSet, session);
|
||||||
session->GetLocalDestination ()->RequestDestination(addr->identHash,
|
else
|
||||||
std::bind(&SAMSocket::HandleConnectLeaseSetRequestComplete,
|
{
|
||||||
shared_from_this(), std::placeholders::_1));
|
session->GetLocalDestination ()->RequestDestination(addr->identHash,
|
||||||
|
std::bind(&SAMSocket::HandleConnectLeaseSetRequestComplete,
|
||||||
|
shared_from_this(), std::placeholders::_1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
SendStreamCantReachPeer ("Can't connect to myself");
|
||||||
}
|
}
|
||||||
else // B33
|
else // B33
|
||||||
session->GetLocalDestination ()->RequestDestinationWithEncryptedLeaseSet (addr->blindedPublicKey,
|
session->GetLocalDestination ()->RequestDestinationWithEncryptedLeaseSet (addr->blindedPublicKey,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user