|
|
|
@ -1424,16 +1424,17 @@ namespace transport
@@ -1424,16 +1424,17 @@ namespace transport
|
|
|
|
|
else |
|
|
|
|
LogPrint (eLogError, "NTCP2: Connected from error ", ec.message ()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogError, "NTCP2: Accept error ", error.message ()); |
|
|
|
|
if (error == boost::asio::error::no_descriptors) |
|
|
|
|
else if (error == boost::asio::error::no_descriptors) |
|
|
|
|
{ |
|
|
|
|
i2p::context.SetError (eRouterErrorNoDescriptors); |
|
|
|
|
// TODO
|
|
|
|
|
return; |
|
|
|
|
if (m_NoFileExhaustTimestamp < i2p::util::GetSecondsSinceEpoch () - NTCP2_DESCRIPTORS_EXHAUST_TIMEOUT) |
|
|
|
|
{ |
|
|
|
|
m_NoFileExhaustTimestamp = i2p::util::GetSecondsSinceEpoch (); |
|
|
|
|
LogPrint (eLogWarning, "NTCP2: WARNING! i2pd met file descriptors exhaustion! Please check your nofile limits!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
LogPrint (eLogError, "NTCP2: Accept error ", error.message ()); |
|
|
|
|
|
|
|
|
|
if (error != boost::asio::error::operation_aborted) |
|
|
|
|
{ |
|
|
|
@ -1463,22 +1464,26 @@ namespace transport
@@ -1463,22 +1464,26 @@ namespace transport
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
LogPrint (eLogError, "NTCP2: Connected from error ", ec.message ()); |
|
|
|
|
LogPrint (eLogError, "NTCP2: Connected from ipv6 error: ", ec.message ()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogError, "NTCP2: Accept ipv6 error ", error.message ()); |
|
|
|
|
if (error == boost::asio::error::no_descriptors) |
|
|
|
|
else if (error == boost::asio::error::no_descriptors) |
|
|
|
|
{ |
|
|
|
|
i2p::context.SetErrorV6 (eRouterErrorNoDescriptors); |
|
|
|
|
// TODO
|
|
|
|
|
return; |
|
|
|
|
if (m_NoFileExhaustTimestamp < i2p::util::GetSecondsSinceEpoch () - NTCP2_DESCRIPTORS_EXHAUST_TIMEOUT) |
|
|
|
|
{ |
|
|
|
|
m_NoFileExhaustTimestamp = i2p::util::GetSecondsSinceEpoch (); |
|
|
|
|
LogPrint (eLogWarning, "NTCP2: WARNING! i2pd met file descriptors exhaustion! Please check your nofile limits!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
LogPrint (eLogError, "NTCP2: Accept ipv6 error: ", error.message ()); |
|
|
|
|
|
|
|
|
|
if (error != boost::asio::error::operation_aborted) |
|
|
|
|
{ |
|
|
|
|
if (!conn) // connection is used, create new one
|
|
|
|
|
conn = std::make_shared<NTCP2Session> (*this); |
|
|
|
|
else // reuse failed
|
|
|
|
|
conn->Close (); |
|
|
|
|
m_NTCP2V6Acceptor->async_accept(conn->GetSocket (), std::bind (&NTCP2Server::HandleAcceptV6, this, |
|
|
|
|
conn, std::placeholders::_1)); |
|
|
|
|
} |
|
|
|
|