mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Up level for some logs to critical
This commit is contained in:
parent
a80aeb6715
commit
354a04f0f6
21 changed files with 95 additions and 94 deletions
|
@ -259,7 +259,7 @@ namespace data
|
|||
publicKeyLength = i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH;
|
||||
break;
|
||||
default:
|
||||
LogPrint (eLogError, "Blinding: Can't blind signature type ", (int)m_SigType);
|
||||
LogPrint (eLogCritical, "Blinding: Can't blind signature type ", (int)m_SigType);
|
||||
}
|
||||
return publicKeyLength;
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ namespace data
|
|||
break;
|
||||
}
|
||||
default:
|
||||
LogPrint (eLogError, "Blinding: Can't blind signature type ", (int)m_SigType);
|
||||
LogPrint (eLogCritical, "Blinding: Can't blind signature type ", (int)m_SigType);
|
||||
}
|
||||
return publicKeyLength;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace client
|
|||
if (authType >= i2p::data::ENCRYPTED_LEASESET_AUTH_TYPE_NONE && authType <= i2p::data::ENCRYPTED_LEASESET_AUTH_TYPE_PSK)
|
||||
m_AuthType = authType;
|
||||
else
|
||||
LogPrint (eLogError, "Destination: Unknown auth type ", authType);
|
||||
LogPrint (eLogCritical, "Destination: Unknown auth type ", authType);
|
||||
}
|
||||
}
|
||||
it = params->find (I2CP_PARAM_LEASESET_PRIV_KEY);
|
||||
|
@ -117,7 +117,7 @@ namespace client
|
|||
m_LeaseSetPrivKey.reset (new i2p::data::Tag<32>());
|
||||
if (m_LeaseSetPrivKey->FromBase64 (it->second) != 32)
|
||||
{
|
||||
LogPrint(eLogError, "Destination: Invalid value i2cp.leaseSetPrivKey ", it->second);
|
||||
LogPrint(eLogCritical, "Destination: Invalid value i2cp.leaseSetPrivKey ", it->second);
|
||||
m_LeaseSetPrivKey.reset (nullptr);
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ namespace client
|
|||
}
|
||||
catch (std::exception & ex)
|
||||
{
|
||||
LogPrint(eLogError, "Destination: Unable to parse parameters for destination: ", ex.what());
|
||||
LogPrint(eLogCritical, "Destination: Unable to parse parameters for destination: ", ex.what());
|
||||
}
|
||||
SetNumTags (numTags);
|
||||
m_Pool = i2p::tunnel::tunnels.CreateTunnelPool (inLen, outLen, inQty, outQty, inVar, outVar);
|
||||
|
@ -1014,12 +1014,12 @@ namespace client
|
|||
else if (authType == i2p::data::ENCRYPTED_LEASESET_AUTH_TYPE_PSK)
|
||||
ReadAuthKey (I2CP_PARAM_LEASESET_CLIENT_PSK, params);
|
||||
else
|
||||
LogPrint (eLogError, "Destination: Unexpected auth type ", authType);
|
||||
LogPrint (eLogCritical, "Destination: Unexpected auth type ", authType);
|
||||
if (m_AuthKeys->size ())
|
||||
LogPrint (eLogInfo, "Destination: ", m_AuthKeys->size (), " auth keys read");
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "Destination: No auth keys read for auth type ", authType);
|
||||
LogPrint (eLogCritical, "Destination: No auth keys read for auth type ", authType);
|
||||
m_AuthKeys = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -1028,7 +1028,7 @@ namespace client
|
|||
}
|
||||
catch (std::exception & ex)
|
||||
{
|
||||
LogPrint(eLogError, "Destination: Unable to parse parameters for destination: ", ex.what());
|
||||
LogPrint(eLogCritical, "Destination: Unable to parse parameters for destination: ", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1336,7 +1336,7 @@ namespace client
|
|||
f1.write ((char *)keys->priv, 256);
|
||||
return;
|
||||
}
|
||||
LogPrint(eLogError, "Destinations: Can't save keys to ", path);
|
||||
LogPrint(eLogCritical, "Destinations: Can't save keys to ", path);
|
||||
}
|
||||
|
||||
void ClientDestination::CreateNewLeaseSet (const std::vector<std::shared_ptr<i2p::tunnel::InboundTunnel> >& tunnels)
|
||||
|
@ -1413,7 +1413,7 @@ namespace client
|
|||
if (pubKey.FromBase64 (it.second.substr (pos+1)))
|
||||
m_AuthKeys->push_back (pubKey);
|
||||
else
|
||||
LogPrint (eLogError, "Destination: Unexpected auth key ", it.second.substr (pos+1));
|
||||
LogPrint (eLogCritical, "Destination: Unexpected auth key ", it.second.substr (pos+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,14 +77,14 @@ namespace data
|
|||
verifier->SetPublicKey (signingKey);
|
||||
}
|
||||
else
|
||||
LogPrint (eLogWarning, "Family: elliptic curve ", curve, " is not supported");
|
||||
LogPrint (eLogCritical, "Family: elliptic curve ", curve, " is not supported");
|
||||
}
|
||||
EC_KEY_free (ecKey);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LogPrint (eLogWarning, "Family: Certificate key type ", keyType, " is not supported");
|
||||
LogPrint (eLogCritical, "Family: Certificate key type ", keyType, " is not supported");
|
||||
}
|
||||
EVP_PKEY_free (pkey);
|
||||
if (verifier && cn)
|
||||
|
@ -93,7 +93,7 @@ namespace data
|
|||
SSL_free (ssl);
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "Family: Can't open certificate file ", filename);
|
||||
LogPrint (eLogCritical, "Family: Can't open certificate file ", filename);
|
||||
SSL_CTX_free (ctx);
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ namespace data
|
|||
int numCertificates = 0;
|
||||
|
||||
if (!i2p::fs::ReadDir(certDir, files)) {
|
||||
LogPrint(eLogWarning, "Family: Can't load family certificates from ", certDir);
|
||||
LogPrint(eLogError, "Family: Can't load family certificates from ", certDir);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -185,13 +185,13 @@ namespace data
|
|||
delete[] b64;
|
||||
}
|
||||
else
|
||||
LogPrint (eLogWarning, "Family: elliptic curve ", curve, " is not supported");
|
||||
LogPrint (eLogCritical, "Family: elliptic curve ", curve, " is not supported");
|
||||
}
|
||||
}
|
||||
SSL_free (ssl);
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "Family: Can't open keys file: ", filename);
|
||||
LogPrint (eLogCritical, "Family: Can't open keys file: ", filename);
|
||||
SSL_CTX_free (ctx);
|
||||
return sig;
|
||||
}
|
||||
|
|
|
@ -369,7 +369,7 @@ namespace data
|
|||
void IdentityEx::CreateVerifier ()
|
||||
{
|
||||
if (!m_Verifier)
|
||||
{
|
||||
{
|
||||
auto verifier = CreateVerifier (GetSigningKeyType ());
|
||||
if (verifier)
|
||||
{
|
||||
|
@ -388,7 +388,7 @@ namespace data
|
|||
}
|
||||
}
|
||||
m_Verifier.reset (verifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<i2p::crypto::CryptoKeyEncryptor> IdentityEx::CreateEncryptor (CryptoKeyType keyType, const uint8_t * key)
|
||||
|
@ -755,7 +755,7 @@ namespace data
|
|||
i2p::crypto::CreateECIESX25519AEADRatchetRandomKeys (priv, pub);
|
||||
break;
|
||||
default:
|
||||
LogPrint (eLogError, "Identity: Crypto key type ", (int)type, " is not supported");
|
||||
LogPrint (eLogCritical, "Identity: Crypto key type ", (int)type, " is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace data
|
|||
LogPrint (eLogDebug, "LeaseSet: Read num=", (int)num);
|
||||
if (!num || num > MAX_NUM_LEASES)
|
||||
{
|
||||
LogPrint (eLogError, "LeaseSet: Rncorrect number of leases", (int)num);
|
||||
LogPrint (eLogError, "LeaseSet: Incorrect number of leases", (int)num);
|
||||
m_IsValid = false;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -127,13 +127,13 @@ namespace log {
|
|||
void Log::SetLogLevel (const std::string& level_) {
|
||||
std::string level=str_tolower(level_);
|
||||
if (level == "none") { m_MinLevel = eLogNone; }
|
||||
else if (level == "critical") { m_MinLevel = eLogCritical}
|
||||
else if (level == "critical") { m_MinLevel = eLogCritical; }
|
||||
else if (level == "error") { m_MinLevel = eLogError; }
|
||||
else if (level == "warn") { m_MinLevel = eLogWarning; }
|
||||
else if (level == "info") { m_MinLevel = eLogInfo; }
|
||||
else if (level == "debug") { m_MinLevel = eLogDebug; }
|
||||
else {
|
||||
LogPrint(eLogError, "Log: Unknown loglevel: ", level);
|
||||
LogPrint(eLogCritical, "Log: Unknown loglevel: ", level);
|
||||
return;
|
||||
}
|
||||
LogPrint(eLogInfo, "Log: Logging level set to ", level);
|
||||
|
@ -216,7 +216,7 @@ namespace log {
|
|||
m_LogStream = os;
|
||||
return;
|
||||
}
|
||||
LogPrint(eLogError, "Log: Can't open file ", path);
|
||||
LogPrint(eLogCritical, "Log: Can't open file ", path);
|
||||
}
|
||||
|
||||
void Log::SendTo (std::shared_ptr<std::ostream> os) {
|
||||
|
|
|
@ -1242,7 +1242,7 @@ namespace transport
|
|||
boost::system::error_code e;
|
||||
auto itr = m_Resolver.resolve(q, e);
|
||||
if(e)
|
||||
LogPrint(eLogError, "NTCP2: Failed to resolve proxy ", e.message());
|
||||
LogPrint(eLogCritical, "NTCP2: Failed to resolve proxy ", e.message());
|
||||
else
|
||||
{
|
||||
m_ProxyEndpoint.reset (new boost::asio::ip::tcp::endpoint(*itr));
|
||||
|
@ -1270,7 +1270,7 @@ namespace transport
|
|||
}
|
||||
catch ( std::exception & ex )
|
||||
{
|
||||
LogPrint(eLogError, "NTCP2: Failed to bind to v4 port ", address->port, ex.what());
|
||||
LogPrint(eLogCritical, "NTCP2: Failed to bind to v4 port ", address->port, ex.what());
|
||||
ThrowFatal ("Unable to start IPv4 NTCP2 transport at port ", address->port, ": ", ex.what ());
|
||||
continue;
|
||||
}
|
||||
|
@ -1313,7 +1313,7 @@ namespace transport
|
|||
}
|
||||
catch ( std::exception & ex )
|
||||
{
|
||||
LogPrint(eLogError, "NTCP2: Failed to bind to v6 port ", address->port, ": ", ex.what());
|
||||
LogPrint(eLogCritical, "NTCP2: Failed to bind to v6 port ", address->port, ": ", ex.what());
|
||||
ThrowFatal ("Unable to start IPv6 NTCP2 transport at port ", address->port, ": ", ex.what ());
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace data
|
|||
return ProcessSU3Stream (s);
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "Reseed: Can't open file ", filename);
|
||||
LogPrint (eLogCritical, "Reseed: Can't open file ", filename);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ namespace data
|
|||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "Reseed: Can't open file ", filename);
|
||||
LogPrint (eLogCritical, "Reseed: Can't open file ", filename);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ namespace data
|
|||
|
||||
if (verify) // not verified
|
||||
{
|
||||
LogPrint (eLogError, "Reseed: SU3 verification failed");
|
||||
LogPrint (eLogCritical, "Reseed: SU3 verification failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ namespace data
|
|||
SSL_free (ssl);
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "Reseed: Can't open certificate file ", filename);
|
||||
LogPrint (eLogCritical, "Reseed: Can't open certificate file ", filename);
|
||||
SSL_CTX_free (ctx);
|
||||
}
|
||||
|
||||
|
@ -534,17 +534,17 @@ namespace data
|
|||
}
|
||||
// check for valid proxy url schema
|
||||
if (proxyUrl.schema != "http" && proxyUrl.schema != "socks") {
|
||||
LogPrint(eLogError, "Reseed: Bad proxy url: ", proxy);
|
||||
LogPrint(eLogCritical, "Reseed: Bad proxy url: ", proxy);
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
LogPrint(eLogError, "Reseed: Bad proxy url: ", proxy);
|
||||
LogPrint(eLogCritical, "Reseed: Bad proxy url: ", proxy);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
i2p::http::URL url;
|
||||
if (!url.parse(address)) {
|
||||
LogPrint(eLogError, "Reseed: Failed to parse url: ", address);
|
||||
LogPrint(eLogCritical, "Reseed: Failed to parse url: ", address);
|
||||
return "";
|
||||
}
|
||||
url.schema = "https";
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace transport
|
|||
}
|
||||
}
|
||||
else
|
||||
LogPrint (eLogError, "SSU2: Can't start server because port not specified");
|
||||
LogPrint (eLogCritical, "SSU2: Can't start server because port not specified");
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
|
@ -224,7 +224,7 @@ namespace transport
|
|||
}
|
||||
catch (std::exception& ex )
|
||||
{
|
||||
LogPrint (eLogError, "SSU2: Failed to bind to ", localEndpoint, ": ", ex.what());
|
||||
LogPrint (eLogCritical, "SSU2: Failed to bind to ", localEndpoint, ": ", ex.what());
|
||||
ThrowFatal ("Unable to start SSU2 transport on ", localEndpoint, ": ", ex.what ());
|
||||
}
|
||||
return socket;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace transport
|
|||
m_Server (server), m_Address (addr), m_RemoteTransports (0),
|
||||
m_DestConnID (0), m_SourceConnID (0), m_State (eSSU2SessionStateUnknown),
|
||||
m_SendPacketNum (0), m_ReceivePacketNum (0), m_LastDatetimeSentPacketNum (0),
|
||||
m_IsDataReceived (false), m_WindowSize (SSU2_MIN_WINDOW_SIZE),
|
||||
m_IsDataReceived (false), m_WindowSize (SSU2_MIN_WINDOW_SIZE),
|
||||
m_RTT (SSU2_RESEND_INTERVAL), m_RTO (SSU2_RESEND_INTERVAL*SSU2_kAPPA), m_RelayTag (0),
|
||||
m_ConnectTimer (server.GetService ()), m_TerminationReason (eSSU2TerminationReasonNormalClose),
|
||||
m_MaxPayloadSize (SSU2_MIN_PACKET_SIZE - IPV6_HEADER_SIZE - UDP_HEADER_SIZE - 32) // min size
|
||||
|
@ -928,7 +928,7 @@ namespace transport
|
|||
{
|
||||
LogPrint (eLogError, "SSU2: Non zero packet number in SessionConfirmed");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// check if fragmented
|
||||
uint8_t numFragments = header.h.flags[0] & 0x0F;
|
||||
if (numFragments > 1)
|
||||
|
@ -1884,7 +1884,7 @@ namespace transport
|
|||
auto r = i2p::data::netdb.FindRouter (GetRemoteIdentity ()->GetIdentHash ()); // Alice's RI
|
||||
if (r && (r->IsUnreachable () || !i2p::data::netdb.PopulateRouterInfoBuffer (r))) r = nullptr;
|
||||
if (!r) LogPrint (eLogWarning, "SSU2: RelayRequest Alice's router info not found");
|
||||
|
||||
|
||||
uint8_t payload[SSU2_MAX_PACKET_SIZE];
|
||||
size_t payloadSize = r ? CreateRouterInfoBlock (payload, m_MaxPayloadSize - len - 32, r) : 0;
|
||||
if (!payloadSize && r)
|
||||
|
@ -2817,13 +2817,13 @@ namespace transport
|
|||
uint8_t payload[SSU2_MAX_PACKET_SIZE];
|
||||
size_t payloadSize = 0;
|
||||
if (m_SendPacketNum > m_LastDatetimeSentPacketNum + SSU2_SEND_DATETIME_NUM_PACKETS)
|
||||
{
|
||||
{
|
||||
payload[0] = eSSU2BlkDateTime;
|
||||
htobe16buf (payload + 1, 4);
|
||||
htobe32buf (payload + 3, (i2p::util::GetMillisecondsSinceEpoch () + 500)/1000);
|
||||
payloadSize += 7;
|
||||
m_LastDatetimeSentPacketNum = m_SendPacketNum;
|
||||
}
|
||||
}
|
||||
payloadSize += CreateAckBlock (payload + payloadSize, m_MaxPayloadSize - payloadSize);
|
||||
payloadSize += CreatePaddingBlock (payload + payloadSize, m_MaxPayloadSize - payloadSize);
|
||||
SendData (payload, payloadSize);
|
||||
|
|
|
@ -200,10 +200,10 @@ namespace transport
|
|||
i2p::context.SetStatusV6 (eRouterStatusProxy);
|
||||
}
|
||||
else
|
||||
LogPrint(eLogError, "Transports: Unsupported NTCP2 proxy URL ", ntcp2proxy);
|
||||
LogPrint(eLogCritical, "Transports: Unsupported NTCP2 proxy URL ", ntcp2proxy);
|
||||
}
|
||||
else
|
||||
LogPrint(eLogError, "Transports: Invalid NTCP2 proxy URL ", ntcp2proxy);
|
||||
LogPrint(eLogCritical, "Transports: Invalid NTCP2 proxy URL ", ntcp2proxy);
|
||||
}
|
||||
else
|
||||
m_NTCP2Server = new NTCP2Server ();
|
||||
|
@ -225,10 +225,10 @@ namespace transport
|
|||
i2p::context.SetStatusV6 (eRouterStatusProxy);
|
||||
}
|
||||
else
|
||||
LogPrint(eLogError, "Transports: Can't set SSU2 proxy ", ssu2proxy);
|
||||
LogPrint(eLogCritical, "Transports: Can't set SSU2 proxy ", ssu2proxy);
|
||||
}
|
||||
else
|
||||
LogPrint(eLogError, "Transports: Invalid SSU2 proxy URL ", ssu2proxy);
|
||||
LogPrint(eLogCritical, "Transports: Invalid SSU2 proxy URL ", ssu2proxy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue