Skip to content

Commit

Permalink
JsonRpcConnection: don't flush any data on shutdown
Browse files Browse the repository at this point in the history
In fact, this is already done for both loops (for each bulk and for each message of it). So once the remote signals EOF, don't try to get things done until write error (which can't be associated with a particular message anyway, due to buffering), but just let the peer go.
  • Loading branch information
Al2Klimov committed Nov 7, 2024
1 parent 15cd130 commit 3112e1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/remote/jsonrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ void JsonRpcConnection::WriteOutgoingMessages(boost::asio::yield_context yc)
}
}

if (m_ShuttingDown) {
return;
}

m_Stream->async_flush(yc);
} catch (const std::exception& ex) {
Log(m_ShuttingDown ? LogDebug : LogWarning, "JsonRpcConnection")
Expand Down

0 comments on commit 3112e1f

Please sign in to comment.