Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7041 from EOSIO/net-plugin-close-fix-dev
Browse files Browse the repository at this point in the history
Fix for close() called while async_read in-flight - develop
  • Loading branch information
heifner committed Apr 1, 2019
2 parents 68f5cc6 + cc4d83b commit 0c68d50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ namespace eosio {
fc_dlog(logger, "canceling wait on ${p}", ("p",peer_name()));
cancel_wait();
if( read_delay_timer ) read_delay_timer->cancel();
pending_message_buffer.reset();
}

void connection::txn_send_pending(const vector<transaction_id_type>& ids) {
Expand Down Expand Up @@ -1886,6 +1885,7 @@ namespace eosio {
auto current_endpoint = *endpoint_itr;
++endpoint_itr;
c->connecting = true;
c->pending_message_buffer.reset();
connection_wptr weak_conn = c;
c->socket->async_connect( current_endpoint, boost::asio::bind_executor( c->strand,
[weak_conn, endpoint_itr, this]( const boost::system::error_code& err ) {
Expand Down Expand Up @@ -2061,7 +2061,7 @@ namespace eosio {
[this,weak_conn]( boost::system::error_code ec, std::size_t bytes_transferred ) {
app().post( priority::medium, [this,weak_conn, ec, bytes_transferred]() {
auto conn = weak_conn.lock();
if (!conn) {
if (!conn || !conn->socket || !conn->socket->is_open()) {
return;
}

Expand Down

0 comments on commit 0c68d50

Please sign in to comment.