提交 5a5cfe81 编写于 作者: P Phil Mesnier

add back necesarry setps for acccepting a client connection. ref #291 and #306

上级 1a5a5950
......@@ -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<tcp::socket>( std::ref( app().get_io_service() ) );
acceptor->async_accept( *socket, [socket,this]( boost::system::error_code ec ) {
if( !ec ) {
start_session( std::make_shared<connection>( socket ) );
connection_ptr c = std::make_shared<connection>( socket );
connections.insert( c );
start_session( c );
start_listen_loop();
} else {
elog( "Error accepting connection: ${m}", ("m", ec.message() ) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册