fix indent in HTTPServer, add RI log messages

This commit is contained in:
R4SAS 2019-05-22 23:29:35 +03:00
parent 7ab29950a4
commit 0e89452056
4 changed files with 36 additions and 33 deletions

View file

@ -258,11 +258,11 @@ namespace http {
s << "<label for='slide-info'>Hidden content. Press on text to see.</label>\r\n<input type='checkbox' id='slide-info'/>\r\n<p class='content'>\r\n";
}
if(includeHiddenContent) {
s << "<b>Router Ident:</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
s << "<b>Router Family:</b> " << i2p::context.GetRouterInfo().GetProperty("family") << "<br>\r\n";
s << "<b>Router Caps:</b> " << i2p::context.GetRouterInfo().GetProperty("caps") << "<br>\r\n";
s << "<b>Router Ident:</b> " << i2p::context.GetRouterInfo ().GetIdentHashBase64 () << "<br>\r\n";
s << "<b>Router Family:</b> " << i2p::context.GetRouterInfo ().GetProperty ("family") << "<br>\r\n";
s << "<b>Router Caps:</b> " << i2p::context.GetRouterInfo ().GetProperty ("caps") << "<br>\r\n";
s << "<b>Our external address:</b>" << "<br>\r\n" ;
for (const auto& address : i2p::context.GetRouterInfo().GetAddresses())
for (const auto& address : i2p::context.GetRouterInfo ().GetAddresses ())
{
if (address->IsNTCP2 () && !address->IsPublishedNTCP2 ())
{

View file

@ -621,10 +621,10 @@ namespace i2p
m_RouterInfo.DeleteProperty ("coreVersion");
m_RouterInfo.DeleteProperty ("stat_uptime");
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
/*bool ipv4; i2p::config::GetOption("ipv4", ipv4);
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
SetSupportsV4(ipv4);
SetSupportsV6(ipv6);
SetSupportsV6(ipv6);*/
}
else
{

View file

@ -677,6 +677,7 @@ namespace data
for (const auto& it: *m_Addresses) // don't insert same address twice
if (*it == *addr) return;
m_SupportedTransports |= addr->host.is_v6 () ? eNTCPV6 : eNTCPV4;
LogPrint (eLogInfo, "RouterInfo: added NTCP address ", addr->host.to_string(), ":", addr->port, " to our RI");
m_Addresses->push_front(std::move(addr)); // always make NTCP first
}
@ -694,6 +695,7 @@ namespace data
for (const auto& it: *m_Addresses) // don't insert same address twice
if (*it == *addr) return;
m_SupportedTransports |= addr->host.is_v6 () ? eSSUV6 : eSSUV4;
LogPrint (eLogInfo, "RouterInfo: added SSU address ", addr->host.to_string(), ":", addr->port, " to our RI");
m_Addresses->push_back(std::move(addr));
m_Caps |= eSSUTesting;
@ -713,6 +715,7 @@ namespace data
if (port) addr->ntcp2->isPublished = true;
memcpy (addr->ntcp2->staticKey, staticKey, 32);
memcpy (addr->ntcp2->iv, iv, 16);
LogPrint (eLogInfo, "RouterInfo: added NTCP2 address ", addr->host.to_string(), ":", addr->port, " to our RI");
m_Addresses->push_back(std::move(addr));
}

View file

@ -447,7 +447,7 @@ namespace transport
else
LogPrint (eLogDebug, "Transports: NTCP address is not present for ", i2p::data::GetIdentHashAbbreviation (ident), ", trying SSU");
}
if (peer.numAttempts == 2)// SSU
if (peer.numAttempts == 2) // SSU
{
peer.numAttempts++;
auto address = peer.router->GetSSUAddress (!context.SupportsV6 ());