From 5a5cfe81889317615368d263c9787297a9d38da6 Mon Sep 17 00:00:00 2001 From: Phil Mesnier Date: Sun, 3 Sep 2017 00:14:07 -0500 Subject: [PATCH] add back necesarry setps for acccepting a client connection. ref #291 and #306 --- plugins/net_plugin/net_plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index e1180b541..335655720 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -142,9 +142,13 @@ namespace eos { } ~connection() { - wlog( "released connection" ); + if (peer_addr.empty()) + wlog( "released connection from client" ); + else + wlog( "released connection to server at ${addr}", ("addr", peer_addr) ); } + block_state_index block_state; transaction_state_index trx_state; sync_request_index in_sync_state; // we are requesting info from this peer @@ -366,7 +370,9 @@ namespace eos { auto socket = std::make_shared( std::ref( app().get_io_service() ) ); acceptor->async_accept( *socket, [socket,this]( boost::system::error_code ec ) { if( !ec ) { - start_session( std::make_shared( socket ) ); + connection_ptr c = std::make_shared( socket ); + connections.insert( c ); + start_session( c ); start_listen_loop(); } else { elog( "Error accepting connection: ${m}", ("m", ec.message() ) ); -- GitLab