fix warnings about unused code

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/1833/head
R4SAS 1 year ago
parent 01fc21ffb9
commit 2c19da9aa7
No known key found for this signature in database
GPG Key ID: 66F6C87B98EBCFE2

@ -87,8 +87,6 @@ namespace http {
const char HTTP_COMMAND_GET_REG_STRING[] = "get_reg_string";
const char HTTP_COMMAND_SETLANGUAGE[] = "setlanguage";
const char HTTP_COMMAND_RELOAD_CSS[] = "reload_css";
const char HTTP_PARAM_SAM_SESSION_ID[] = "id";
const char HTTP_PARAM_ADDRESS[] = "address";
static std::string ConvertTime (uint64_t time)
{
@ -301,7 +299,7 @@ namespace http {
if ((outputFormat == OutputFormatEnum::forWebConsole) || !includeHiddenContent) {
s << "<label for=\"slide-info\">" << tr("Hidden content. Press on text to see.") << "</label>\r\n<input type=\"checkbox\" id=\"slide-info\" />\r\n<div class=\"slidecontent\">\r\n";
}
if (includeHiddenContent)
if (includeHiddenContent)
{
s << "<b>" << tr("Router Ident") << ":</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
if (!i2p::context.GetRouterInfo().GetProperty("family").empty())
@ -311,7 +309,7 @@ namespace http {
s << "<b>"<< tr("Our external address") << ":</b>" << "<br>\r\n<table class=\"extaddr\"><tbody>\r\n";
auto addresses = i2p::context.GetRouterInfo().GetAddresses ();
if (addresses)
{
{
for (const auto& address : *addresses)
{
if (!address) continue;
@ -344,7 +342,7 @@ namespace http {
}
s << "</tr>\r\n";
}
}
}
s << "</tbody></table>\r\n";
}
s << "</div>\r\n</div>\r\n";

@ -135,7 +135,7 @@ namespace data
//----------------------------------------------------------
const uint8_t B33_TWO_BYTES_SIGTYPE_FLAG = 0x01;
const uint8_t B33_PER_SECRET_FLAG = 0x02; // not used for now
// const uint8_t B33_PER_SECRET_FLAG = 0x02; // not used for now
const uint8_t B33_PER_CLIENT_AUTH_FLAG = 0x04;
BlindedPublicKey::BlindedPublicKey (std::shared_ptr<const IdentityEx> identity, bool clientAuth):

@ -159,8 +159,10 @@ namespace crypto
// DH/ElGamal
#if !defined(__x86_64__)
const int ELGAMAL_SHORT_EXPONENT_NUM_BITS = 226;
const int ELGAMAL_SHORT_EXPONENT_NUM_BYTES = ELGAMAL_SHORT_EXPONENT_NUM_BITS/8+1;
#endif
const int ELGAMAL_FULL_EXPONENT_NUM_BITS = 2048;
const int ELGAMAL_FULL_EXPONENT_NUM_BYTES = ELGAMAL_FULL_EXPONENT_NUM_BITS/8;

@ -1453,17 +1453,17 @@ namespace transport
LogPrint (eLogError, "NTCP2: Connected from error ", ec.message ());
}
else
{
{
LogPrint (eLogError, "NTCP2: Accept error ", error.message ());
if (error == boost::asio::error::no_descriptors)
{
i2p::context.SetError (eRouterErrorNoDescriptors);
return;
}
}
return;
}
}
if (error != boost::asio::error::operation_aborted)
{
{
if (!conn) // connection is used, create new one
conn = std::make_shared<NTCP2Session> (*this);
else // reuse failed
@ -1504,14 +1504,14 @@ namespace transport
LogPrint (eLogError, "NTCP2: Connected from error ", ec.message ());
}
else
{
{
LogPrint (eLogError, "NTCP2: Accept ipv6 error ", error.message ());
if (error == boost::asio::error::no_descriptors)
{
i2p::context.SetErrorV6 (eRouterErrorNoDescriptors);
return;
}
}
return;
}
}
if (error != boost::asio::error::operation_aborted)
{
@ -1560,23 +1560,23 @@ namespace transport
it++;
}
ScheduleTermination ();
// try to restart acceptors if no description
// we do it after timer to let timer take descriptor first
// we do it after timer to let timer take descriptor first
if (i2p::context.GetError () == eRouterErrorNoDescriptors)
{
i2p::context.SetError (eRouterErrorNone);
auto conn = std::make_shared<NTCP2Session> (*this);
m_NTCP2Acceptor->async_accept(conn->GetSocket (), std::bind (&NTCP2Server::HandleAccept, this,
conn, std::placeholders::_1));
}
}
if (i2p::context.GetErrorV6 () == eRouterErrorNoDescriptors)
{
i2p::context.SetErrorV6 (eRouterErrorNone);
auto conn = std::make_shared<NTCP2Session> (*this);
m_NTCP2V6Acceptor->async_accept(conn->GetSocket (), std::bind (&NTCP2Server::HandleAcceptV6, this,
conn, std::placeholders::_1));
}
}
}
}
@ -1784,15 +1784,15 @@ namespace transport
});
boost::asio::async_read(conn->GetSocket(), boost::asio::buffer(readbuff->data (), SOCKS5_UDP_IPV4_REQUEST_HEADER_SIZE), // read min reply size
boost::asio::transfer_all(),
[timer, conn, sz, readbuff](const boost::system::error_code & e, std::size_t transferred)
boost::asio::transfer_all(),
[timer, conn, readbuff](const boost::system::error_code & e, std::size_t transferred)
{
if (e)
LogPrint(eLogError, "NTCP2: SOCKS proxy read error ", e.message());
else if (!(*readbuff)[1]) // succeeded
{
boost::system::error_code ec;
size_t moreBytes = conn->GetSocket ().available(ec);
size_t moreBytes = conn->GetSocket ().available(ec);
if (moreBytes) // read remaining portion of reply if ipv6 received
boost::asio::read (conn->GetSocket (), boost::asio::buffer(readbuff->data (), moreBytes), boost::asio::transfer_all (), ec);
timer->cancel();

@ -27,7 +27,7 @@ namespace proxy
static const size_t socks_buffer_size = 8192;
static const size_t max_socks_hostname_size = 255; // Limit for socks5 and bad idea to traverse
static const size_t SOCKS_FORWARDER_BUFFER_SIZE = 8192;
//static const size_t SOCKS_FORWARDER_BUFFER_SIZE = 8192;
static const size_t SOCKS_UPSTREAM_SOCKS4A_REPLY_SIZE = 8;

Loading…
Cancel
Save