Skip to content

Commit

Permalink
Fix RPC shutdown in acceptor loop (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptocode authored and rkeene committed Dec 5, 2018
1 parent 7a1d527 commit ad9479e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions rai/node/rpc.cpp
Expand Up @@ -155,8 +155,10 @@ void rai::rpc::accept ()
{
auto connection (std::make_shared<rai::rpc_connection> (node, *this));
acceptor.async_accept (connection->socket, [this, connection](boost::system::error_code const & ec) {
accept ();

if (acceptor.is_open ())
{
accept ();
}
if (!ec)
{
connection->parse_connection ();
Expand Down
6 changes: 4 additions & 2 deletions rai/node/rpc_secure.cpp
Expand Up @@ -97,8 +97,10 @@ void rai::rpc_secure::accept ()
{
auto connection (std::make_shared<rai::rpc_connection_secure> (node, *this));
acceptor.async_accept (connection->socket, [this, connection](boost::system::error_code const & ec) {
accept ();

if (acceptor.is_open ())
{
accept ();
}
if (!ec)
{
connection->parse_connection ();
Expand Down

0 comments on commit ad9479e

Please sign in to comment.