mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
show correct tunnel status. restore tunnel if delivery status or data for inbound tunnel received
This commit is contained in:
parent
710b27688b
commit
0e502c49b5
3 changed files with 10 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
|
@ -133,23 +133,19 @@ namespace http {
|
|||
static void ShowTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, int bytes)
|
||||
{
|
||||
std::string state, stateText;
|
||||
switch (eState) {
|
||||
switch (eState)
|
||||
{
|
||||
case i2p::tunnel::eTunnelStateBuildReplyReceived :
|
||||
case i2p::tunnel::eTunnelStatePending : state = "building"; break;
|
||||
case i2p::tunnel::eTunnelStateBuildFailed :
|
||||
case i2p::tunnel::eTunnelStateTestFailed :
|
||||
case i2p::tunnel::eTunnelStateBuildFailed : state = "failed"; stateText = "declined"; break;
|
||||
case i2p::tunnel::eTunnelStateTestFailed : state = "failed"; stateText = "test failed"; break;
|
||||
case i2p::tunnel::eTunnelStateFailed : state = "failed"; break;
|
||||
case i2p::tunnel::eTunnelStateExpiring : state = "expiring"; break;
|
||||
case i2p::tunnel::eTunnelStateEstablished : state = "established"; break;
|
||||
default: state = "unknown"; break;
|
||||
}
|
||||
|
||||
if (state == "building") stateText = tr("building");
|
||||
else if (state == "failed") stateText = tr("failed");
|
||||
else if (state == "expiring") stateText = tr("expiring");
|
||||
else if (state == "established") stateText = tr("established");
|
||||
else stateText = tr("unknown");
|
||||
|
||||
if (stateText.empty ()) stateText = tr(state);
|
||||
|
||||
s << "<span class=\"tunnel " << state << "\"> " << stateText << ((explr) ? " (" + tr("exploratory") + ")" : "") << "</span>, ";
|
||||
ShowTraffic(s, bytes);
|
||||
s << "\r\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue