Skip to content

Commit

Permalink
GH-1349 If socket closed, but close not call, call close
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jul 4, 2023
1 parent d46d7e9 commit bd7ff14
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 @@ -1242,7 +1242,7 @@ namespace eosio {
try {
c->buffer_queue.clear_out_queue();
// May have closed connection and cleared buffer_queue
if( !c->socket_is_open() || socket != c->socket ) {
if( !c->socket->is_open() || socket != c->socket ) {
peer_ilog( c, "async write socket ${r} before callback", ("r", c->socket_is_open() ? "changed" : "closed") );
c->close();
return;
Expand Down Expand Up @@ -2488,7 +2488,7 @@ namespace eosio {
boost::asio::bind_executor( strand,
[conn = shared_from_this(), socket=socket]( boost::system::error_code ec, std::size_t bytes_transferred ) {
// may have closed connection and cleared pending_message_buffer
if (!conn->socket_is_open() && conn->socket_open) { // if socket_open then close not called
if (!conn->socket->is_open() && conn->socket_is_open()) { // if socket_open then close not called
peer_dlog( conn, "async_read socket not open, closing");
conn->close();
return;
Expand Down

0 comments on commit bd7ff14

Please sign in to comment.