diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp
index fd57dc75..ad6f065b 100644
--- a/daemon/HTTPServer.cpp
+++ b/daemon/HTTPServer.cpp
@@ -439,61 +439,20 @@ namespace http {
else if (state == "established") stateText = tr("established");
else stateText = tr("unknown");
- if (!explr) {
- s << ""
- << stateText << ((explr) ? " (" + tr("exploratory") + ")" : "") << "";
- s << std::fixed << std::setprecision(0);
- if (bytes > 1024 * 1024 * 1024) {
- s << std::fixed << std::setprecision(2);
- s << " " << (double) (bytes / 1024 / 1024 / 1024) << "G\r\n";
- } else if (bytes > 1024 * 1024) {
- s << std::fixed << std::setprecision(1);
- s << " " << (double) (bytes / 1024 / 1024) << "M\r\n";
- } else if (bytes > 1024) {
- s << " " << (int) (bytes / 1024) << "K\r\n";
- } else {
- s << " " << (int) (bytes) << "B\r\n";
- }
- }
- }
-
- static void ShowExploratoryTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, double bytes)
- {
- std::string state, stateText;
- switch (eState) {
- case i2p::tunnel::eTunnelStateBuildReplyReceived :
- case i2p::tunnel::eTunnelStatePending : state = "building"; break;
- case i2p::tunnel::eTunnelStateBuildFailed :
- case i2p::tunnel::eTunnelStateTestFailed :
- 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 (explr) {
- s << ""
- << stateText << " (" << tr("exploratory") << ")";
- s << std::fixed << std::setprecision(0);
- if (bytes > 1024 * 1024 * 1024) {
- s << std::fixed << std::setprecision(2);
- s << " " << (double) (bytes / 1024 / 1024 / 1024) << "G\r\n";
- } else if (bytes > 1024 * 1024) {
- s << std::fixed << std::setprecision(1);
- s << " " << (double) (bytes / 1024 / 1024) << "M\r\n";
- } else if (bytes > 1024) {
- s << " " << (int) (bytes / 1024) << "K\r\n";
- } else {
- s << " " << (int) (bytes) << "B\r\n";
- }
+ s << ""
+ << stateText << ((explr) ? " (" + tr("exploratory") + ")" : "") << "";
+ s << std::fixed << std::setprecision(0);
+ if (bytes > 1024 * 1024 * 1024) {
+ s << std::fixed << std::setprecision(2);
+ s << " " << (double) (bytes / 1024 / 1024 / 1024) << "G\r\n";
+ } else if (bytes > 1024 * 1024) {
+ s << std::fixed << std::setprecision(1);
+ s << " " << (double) (bytes / 1024 / 1024) << "M\r\n";
+ } else if (bytes > 1024) {
+ s << " " << (int) (bytes / 1024) << "K\r\n";
+ } else {
+ s << " " << (int) (bytes) << "B\r\n";
}
}
@@ -1116,7 +1075,7 @@ namespace http {
} else { // placeholder for alignment
s << " --- ";
}
- ShowExploratoryTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumReceivedBytes ());
+ ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumReceivedBytes ());
s << "\r\n";
}
}
@@ -1137,7 +1096,7 @@ namespace http {
} else { // placeholder for alignment
s << " --- ";
}
- ShowExploratoryTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumSentBytes ());
+ ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumSentBytes ());
s << "\r\n\r\n";
}
}