Browse Source

reduced numeber of error messages

pull/352/head
orignal 9 years ago
parent
commit
c053bebccd
  1. 22
      NTCPSession.cpp
  2. 2
      NTCPSession.h
  3. 6
      SSUData.cpp
  4. 18
      SSUSession.cpp
  5. 2
      Transports.cpp
  6. 4
      Tunnel.cpp

22
NTCPSession.cpp

@ -136,7 +136,7 @@ namespace transport @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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)
{

2
NTCPSession.h

@ -134,7 +134,7 @@ namespace transport @@ -134,7 +134,7 @@ namespace transport
{
public:
NTCPServer (int port);
NTCPServer ();
~NTCPServer ();
void Start ();

6
SSUData.cpp

@ -352,7 +352,7 @@ namespace transport @@ -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 @@ -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 @@ -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);
}
}

18
SSUSession.cpp

@ -113,14 +113,14 @@ namespace transport @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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");
}

2
Transports.cpp

@ -117,7 +117,7 @@ namespace transport @@ -117,7 +117,7 @@ namespace transport
{
if (!m_NTCPServer)
{
m_NTCPServer = new NTCPServer (address.port);
m_NTCPServer = new NTCPServer ();
m_NTCPServer->Start ();
}

4
Tunnel.cpp

@ -442,7 +442,7 @@ namespace tunnel @@ -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 @@ -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…
Cancel
Save