From bd7ff14a6136219ff2f9c902718d63e892dc7a83 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Mon, 3 Jul 2023 20:15:08 -0500 Subject: [PATCH] GH-1349 If socket closed, but close not call, call close --- plugins/net_plugin/net_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index bd93128d96..1f051eca00 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -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; @@ -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;