| 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 | { |
nothing calls this directly
no test coverage detected