MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / CheckPendingOutgoingSession

Method CheckPendingOutgoingSession

libi2pd/SSU2.cpp:872–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870 }
871
872 bool SSU2Server::CheckPendingOutgoingSession (const boost::asio::ip::udp::endpoint& ep, bool peerTest)
873 {
874 auto s = FindPendingOutgoingSession (ep);
875 if (s)
876 {
877 if (peerTest)
878 {
879 // if peer test requested add it to the list for pending session
880 auto onEstablished = s->GetOnEstablished ();
881 if (onEstablished)
882 s->SetOnEstablished ([s, onEstablished]()
883 {
884 onEstablished ();
885 s->SendPeerTest ();
886 });
887 else
888 s->SetOnEstablished ([s]() { s->SendPeerTest (); });
889 }
890 return true;
891 }
892 return false;
893 }
894
895 bool SSU2Server::CreateSession (std::shared_ptr<const i2p::data::RouterInfo> router,
896 std::shared_ptr<const i2p::data::RouterInfo::Address> address, bool peerTest)

Callers

nothing calls this directly

Calls 3

GetOnEstablishedMethod · 0.80
SetOnEstablishedMethod · 0.80
SendPeerTestMethod · 0.45

Tested by

no test coverage detected