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

Method HandleShortTunnelBuildMsg

libi2pd/Tunnel.cpp:729–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727 }
728
729 void Tunnels::HandleShortTunnelBuildMsg (std::shared_ptr<I2NPMessage> msg)
730 {
731 if (!msg) return;
732 auto tunnel = GetPendingInboundTunnel (msg->GetMsgID()); // replyMsgID
733 if (tunnel)
734 {
735 // endpoint of inbound tunnel
736 LogPrint (eLogDebug, "Tunnel: ShortTunnelBuild reply for tunnel ", tunnel->GetTunnelID ());
737 if (tunnel->HandleTunnelBuildResponse (msg->GetPayload(), msg->GetPayloadLength()))
738 {
739 LogPrint (eLogInfo, "Tunnel: Inbound tunnel ", tunnel->GetTunnelID (), " has been created");
740 tunnel->SetState (eTunnelStateEstablished);
741 AddInboundTunnel (tunnel);
742 }
743 else
744 {
745 LogPrint (eLogInfo, "Tunnel: Inbound tunnel ", tunnel->GetTunnelID (), " has been declined");
746 tunnel->SetState (eTunnelStateBuildFailed);
747 }
748 return;
749 }
750 else
751 m_TransitTunnels.PostTransitTunnelBuildMsg (std::move (msg));
752 }
753
754 void Tunnels::HandleVariableTunnelBuildMsg (std::shared_ptr<I2NPMessage> msg)
755 {

Callers

nothing calls this directly

Calls 8

LogPrintFunction · 0.85
GetPayloadLengthMethod · 0.80
GetMsgIDMethod · 0.45
GetTunnelIDMethod · 0.45
GetPayloadMethod · 0.45
SetStateMethod · 0.45

Tested by

no test coverage detected