Skip to content

Commit

Permalink
No descriptors error
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Dec 10, 2022
1 parent 53ca5dc commit 737603e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions daemon/HTTPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ namespace http {
case eRouterErrorSymmetricNAT:
s << " - " << tr("Symmetric NAT");
break;
case eRouterErrorNoDescriptors:
s << " - " << tr("No Descriptors");
break;
default: ;
}
}
Expand Down
22 changes: 20 additions & 2 deletions libi2pd/NTCP2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,10 +1425,18 @@ 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);
// TODO
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
Expand Down Expand Up @@ -1457,6 +1465,16 @@ namespace transport
else
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);
// TODO
return;
}
}

if (error != boost::asio::error::operation_aborted)
{
Expand Down
3 changes: 2 additions & 1 deletion libi2pd/RouterContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ namespace garlic
eRouterErrorNone = 0,
eRouterErrorClockSkew = 1,
eRouterErrorOffline = 2,
eRouterErrorSymmetricNAT = 3
eRouterErrorSymmetricNAT = 3,
eRouterErrorNoDescriptors = 4
};

class RouterContext: public i2p::garlic::GarlicDestination
Expand Down

0 comments on commit 737603e

Please sign in to comment.