mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
check presense of introducers in SSU2 address
This commit is contained in:
parent
9db7ec6bb0
commit
e970deb92b
3 changed files with 9 additions and 13 deletions
|
@ -1124,16 +1124,9 @@ namespace transport
|
|||
else
|
||||
{
|
||||
// we are Alice, message from Bob
|
||||
boost::asio::ip::udp::endpoint ep;
|
||||
if (ExtractEndpoint (buf + 12, buf[11], ep))
|
||||
// update Charlie's endpoint and connect
|
||||
if (ExtractEndpoint (buf + 12, buf[11], it->second.first->m_RemoteEndpoint))
|
||||
{
|
||||
// update Charlie's address and connect
|
||||
auto addr = std::make_shared<i2p::data::RouterInfo::Address> ();
|
||||
auto addr1 = it->second.first->m_Address;
|
||||
addr->transportStyle = i2p::data::RouterInfo::eTransportSSU2;
|
||||
addr->host = ep.address (); addr->port = ep.port ();
|
||||
addr->s = addr1->s; addr->i = addr1->i; addr->caps = addr1->caps;
|
||||
it->second.first->m_Address = addr;
|
||||
it->second.first->m_State = eSSU2SessionStateUnknown;
|
||||
it->second.first->Connect ();
|
||||
}
|
||||
|
@ -1767,12 +1760,15 @@ namespace transport
|
|||
std::shared_ptr<const i2p::data::RouterInfo::Address> address)
|
||||
{
|
||||
if (router && address)
|
||||
{
|
||||
if (address->UsesIntroducer ()) return false; // not implemented yet
|
||||
GetService ().post (
|
||||
[this, router, address]()
|
||||
{
|
||||
auto session = std::make_shared<SSU2Session> (*this, router, address);
|
||||
session->Connect ();
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue