mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
reduced numeber of error messages
This commit is contained in:
parent
6d8b0e3a5d
commit
c053bebccd
|
@ -136,7 +136,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: couldn't send Phase 1 message: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: couldn't send Phase 1 message: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: phase 1 read error: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: phase 1 read error: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Couldn't send Phase 2 message: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Couldn't send Phase 2 message: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Phase 2 read error: ", ecode.message (), ". Wrong ident assumed");
|
||||
LogPrint (eLogInfo, "NTCP: Phase 2 read error: ", ecode.message (), ". Wrong ident assumed");
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
{
|
||||
// this RI is not valid
|
||||
|
@ -299,7 +299,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Couldn't send Phase 3 message: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Couldn't send Phase 3 message: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Phase 3 read error: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Phase 3 read error: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ namespace transport
|
|||
SetRemoteIdentity (std::make_shared<i2p::data::IdentityEx> (buf + 2, size));
|
||||
if (m_Server.FindNTCPSession (m_RemoteIdentity->GetIdentHash ()))
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: session already exists");
|
||||
LogPrint (eLogInfo, "NTCP: session already exists");
|
||||
Terminate ();
|
||||
}
|
||||
size_t expectedSize = size + 2/*size*/ + 4/*timestamp*/ + m_RemoteIdentity->GetSignatureLen ();
|
||||
|
@ -354,7 +354,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Phase 3 extra read error: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Phase 3 extra read error: ", ecode.message ());
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ namespace transport
|
|||
{
|
||||
if (ecode)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Read error: ", ecode.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Read error: ", ecode.message ());
|
||||
if (!m_NumReceivedBytes) m_Server.Ban (m_ConnectedFrom);
|
||||
//if (ecode != boost::asio::error::operation_aborted)
|
||||
Terminate ();
|
||||
|
@ -540,7 +540,7 @@ namespace transport
|
|||
moreBytes = m_Socket.read_some (boost::asio::buffer (m_ReceiveBuffer + m_ReceiveBufferOffset, moreBytes));
|
||||
if (ec)
|
||||
{
|
||||
LogPrint (eLogError, "NTCP: Read more bytes error: ", ec.message ());
|
||||
LogPrint (eLogInfo, "NTCP: Read more bytes error: ", ec.message ());
|
||||
Terminate ();
|
||||
return;
|
||||
}
|
||||
|
@ -732,7 +732,7 @@ namespace transport
|
|||
}
|
||||
|
||||
//-----------------------------------------
|
||||
NTCPServer::NTCPServer (int port):
|
||||
NTCPServer::NTCPServer ():
|
||||
m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service),
|
||||
m_NTCPAcceptor (nullptr), m_NTCPV6Acceptor (nullptr)
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace transport
|
|||
{
|
||||
public:
|
||||
|
||||
NTCPServer (int port);
|
||||
NTCPServer ();
|
||||
~NTCPServer ();
|
||||
|
||||
void Start ();
|
||||
|
|
|
@ -352,7 +352,7 @@ namespace transport
|
|||
}
|
||||
catch (boost::system::system_error& ec)
|
||||
{
|
||||
LogPrint (eLogError, "SSU: Can't send data fragment ", ec.what ());
|
||||
LogPrint (eLogWarning, "SSU: Can't send data fragment ", ec.what ());
|
||||
}
|
||||
if (!isLast)
|
||||
{
|
||||
|
@ -440,7 +440,7 @@ namespace transport
|
|||
}
|
||||
catch (boost::system::system_error& ec)
|
||||
{
|
||||
LogPrint (eLogError, "SSU: Can't resend data fragment ", ec.what ());
|
||||
LogPrint (eLogWarning, "SSU: Can't resend data fragment ", ec.what ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -450,7 +450,7 @@ namespace transport
|
|||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "SSU: message has not been ACKed after ", MAX_NUM_RESENDS, " attempts, deleted");
|
||||
LogPrint (eLogInfo, "SSU: message has not been ACKed after ", MAX_NUM_RESENDS, " attempts, deleted");
|
||||
it = m_SentMessages.erase (it);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,14 +113,14 @@ namespace transport
|
|||
auto address = i2p::context.GetRouterInfo ().GetSSUAddress ();
|
||||
if (!address)
|
||||
{
|
||||
LogPrint (eLogError, "SSU is not supported");
|
||||
LogPrint (eLogInfo, "SSU is not supported");
|
||||
return;
|
||||
}
|
||||
if (Validate (buf, len, address->key))
|
||||
Decrypt (buf, len, address->key);
|
||||
else
|
||||
{
|
||||
LogPrint (eLogError, "SSU: MAC verification failed ", len, " bytes from ", senderEndpoint);
|
||||
LogPrint (eLogWarning, "SSU: MAC verification failed ", len, " bytes from ", senderEndpoint);
|
||||
m_Server.DeleteSession (shared_from_this ());
|
||||
return;
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ namespace transport
|
|||
auto address = i2p::context.GetRouterInfo ().GetSSUAddress ();
|
||||
if (!address)
|
||||
{
|
||||
LogPrint (eLogError, "SSU is not supported");
|
||||
LogPrint (eLogInfo, "SSU is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ namespace transport
|
|||
i2p::context.GetRouterInfo ().GetSSUAddress (true); //v4 only
|
||||
if (!address)
|
||||
{
|
||||
LogPrint (eLogError, "SSU is not supported");
|
||||
LogPrint (eLogInfo, "SSU is not supported");
|
||||
return;
|
||||
}
|
||||
SignedData s; // x,y, remote IP, remote port, our IP, our port, relayTag, signed on time
|
||||
|
@ -508,7 +508,7 @@ namespace transport
|
|||
// Charlie's address always v4
|
||||
if (!to.address ().is_v4 ())
|
||||
{
|
||||
LogPrint (eLogError, "SSU: Charlie's IP must be v4");
|
||||
LogPrint (eLogWarning, "SSU: Charlie's IP must be v4");
|
||||
return;
|
||||
}
|
||||
*payload = 4;
|
||||
|
@ -560,7 +560,7 @@ namespace transport
|
|||
// Alice's address always v4
|
||||
if (!from.address ().is_v4 ())
|
||||
{
|
||||
LogPrint (eLogError, "SSU: Alice's IP must be v4");
|
||||
LogPrint (eLogWarning, "SSU: Alice's IP must be v4");
|
||||
return;
|
||||
}
|
||||
uint8_t buf[48 + 18];
|
||||
|
@ -1015,7 +1015,7 @@ namespace transport
|
|||
if (addr)
|
||||
memcpy (payload, addr->key, 32); // intro key
|
||||
else
|
||||
LogPrint (eLogError, "SSU is not supported. Can't send peer test");
|
||||
LogPrint (eLogInfo, "SSU is not supported. Can't send peer test");
|
||||
}
|
||||
else
|
||||
memcpy (payload, introKey, 32); // intro key
|
||||
|
@ -1044,7 +1044,7 @@ namespace transport
|
|||
auto address = i2p::context.GetRouterInfo ().GetSSUAddress ();
|
||||
if (!address)
|
||||
{
|
||||
LogPrint (eLogError, "SSU is not supported. Can't send peer test");
|
||||
LogPrint (eLogInfo, "SSU is not supported. Can't send peer test");
|
||||
return;
|
||||
}
|
||||
uint32_t nonce;
|
||||
|
@ -1085,7 +1085,7 @@ namespace transport
|
|||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
LogPrint (eLogError, "SSU: exception while send session destoriyed: ", ex.what ());
|
||||
LogPrint (eLogWarning, "SSU: exception while sending session destoroyed: ", ex.what ());
|
||||
}
|
||||
LogPrint (eLogDebug, "SSU: session destroyed sent");
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace transport
|
|||
{
|
||||
if (!m_NTCPServer)
|
||||
{
|
||||
m_NTCPServer = new NTCPServer (address.port);
|
||||
m_NTCPServer = new NTCPServer ();
|
||||
m_NTCPServer->Start ();
|
||||
}
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ namespace tunnel
|
|||
HandleI2NPMessage (msg->GetBuffer (), msg->GetLength ());
|
||||
break;
|
||||
default:
|
||||
LogPrint (eLogError, "Tunnel: unexpected messsage type ", (int) typeID);
|
||||
LogPrint (eLogWarning, "Tunnel: unexpected messsage type ", (int) typeID);
|
||||
}
|
||||
|
||||
msg = m_Queue.Get ();
|
||||
|
@ -551,7 +551,7 @@ namespace tunnel
|
|||
it++;
|
||||
break;
|
||||
case eTunnelStateBuildFailed:
|
||||
LogPrint (eLogError, "Tunnel: pending build request ", it->first, " failed, deleted");
|
||||
LogPrint (eLogWarning, "Tunnel: pending build request ", it->first, " failed, deleted");
|
||||
it = pendingTunnels.erase (it);
|
||||
m_NumFailedTunnelCreations++;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue