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

Fix for close() called while async_read in-flight - develop #7041

Merged
merged 2 commits into from
Apr 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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