diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index e00f273d..48b69a49 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -141,11 +141,10 @@ namespace http { static void SetLogLevel (const std::string& level) { - LogPrint(eLogWarning, "HTTPServer: SetLogLevel ping 2!"); if (level == "none" || level == "error" || level == "warn" || level == "info" || level == "debug") i2p::log::Logger().SetLogLevel(level); else { - LogPrint(eLogWarning, "HTTPServer: unknown loglevel set attemped"); + LogPrint(eLogError, "HTTPServer: unknown loglevel set attemped"); return; } i2p::log::Logger().Reopen (); @@ -246,7 +245,7 @@ namespace http { ShowTraffic (s, i2p::transport::transports.GetTotalTransitTransmittedBytes ()); s << " (" << (double) i2p::transport::transports.GetTransitBandwidth () / 1024 << " KiB/s)
\r\n"; s << "Data path: " << i2p::fs::GetDataDir() << "
\r\n"; - s << "
\r\n\r\n

\r\n"; + s << "

\r\n\r\n

\r\n"; if(includeHiddenContent) { s << "Router Ident: " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "
\r\n"; s << "Router Family: " << i2p::context.GetRouterInfo().GetProperty("family") << "
\r\n"; @@ -330,7 +329,7 @@ namespace http { s << dest->GetIdentity ()->ToBase64 () << "
\r\n
\r\n"; if(dest->GetNumRemoteLeaseSets()) { - s << "

\r\n\r\n

\r\n"; + s << "

\r\n\r\n

\r\n"; for(auto& it: dest->GetLeaseSets ()) s << it.second->GetIdentHash ().ToBase32 () << "
\r\n"; s << "

\r\n
\r\n"; @@ -356,13 +355,15 @@ namespace http { } } s << "
\r\n"; - s << "Tags
Incoming: " << dest->GetNumIncomingTags () << "
Outgoing:
" << std::endl; - for (const auto& it: dest->GetSessions ()) - { - s << i2p::client::context.GetAddressBook ().ToAddress(it.first) << " "; - s << it.second->GetNumOutgoingTags () << "
" << std::endl; - } - s << "
" << std::endl; + s << "Tags
Incoming: " << dest->GetNumIncomingTags () << "
"; + if (!dest->GetSessions ().empty ()) { + s << "
\r\n\r\n

\r\n"; + for (const auto& it: dest->GetSessions ()) + s << i2p::client::context.GetAddressBook ().ToAddress(it.first) << " " << it.second->GetNumOutgoingTags () << "
\r\n"; + s << "

\r\n
\r\n"; + } else + s << "Outgoing: 0
\r\n"; + s << "
\r\n"; } void ShowLocalDestination (std::stringstream& s, const std::string& b32) @@ -375,7 +376,7 @@ namespace http { { ShowLeaseSetDestination (s, dest); // show streams - s << "
\r\n"; + s << "
Streams
\r\n"; s << ""; s << ""; s << ""; @@ -386,7 +387,7 @@ namespace http { s << ""; s << ""; s << ""; - s << ""; + s << "\r\n"; for (const auto& it: dest->GetAllStreams ()) { @@ -401,8 +402,8 @@ namespace http { s << ""; s << ""; s << ""; - s << "
\r\n" << std::endl; - } + s << "\r\n"; + } s << "
Streams
StreamIDDestinationSentRTTWindowStatus
" << it->GetRTT () << "" << it->GetWindowSize () << "" << (int)it->GetStatus () << "
"; } } @@ -563,12 +564,12 @@ namespace http { } if (!tmp_s.str ().empty ()) { - s << "
\r\n\r\n

"; + s << "

\r\n\r\n

"; s << tmp_s.str () << "

\r\n
\r\n"; } if (!tmp_s6.str ().empty ()) { - s << "
\r\n\r\n

"; + s << "

\r\n\r\n

"; s << tmp_s6.str () << "

\r\n
\r\n"; } } @@ -579,7 +580,7 @@ namespace http { auto sessions = ssuServer->GetSessions (); if (!sessions.empty ()) { - s << "
\r\n\r\n

"; + s << "

\r\n\r\n

"; for (const auto& it: sessions) { auto endpoint = it.second->GetRemoteEndpoint (); @@ -596,7 +597,7 @@ namespace http { auto sessions6 = ssuServer->GetSessionsV6 (); if (!sessions6.empty ()) { - s << "

\r\n\r\n

"; + s << "

\r\n\r\n

"; for (const auto& it: sessions6) { auto endpoint = it.second->GetRemoteEndpoint (); @@ -948,7 +949,6 @@ namespace http { i2p::win32::StopWin32App (); #endif } else if (cmd == HTTP_COMMAND_LOGLEVEL){ - LogPrint(eLogWarning, "HTTPServer: SetLogLevel ping 1!"); std::string level = params["level"]; SetLogLevel (level); } else {