From a6eb8379f045f8adab1dcd214fe694ebbf2f9a46 Mon Sep 17 00:00:00 2001 From: Vito <5780819+Tapanito@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:44:26 +0200 Subject: [PATCH] simplifies connect attempt async shutdown --- src/xrpld/overlay/detail/ConnectAttempt.cpp | 9 +++------ src/xrpld/overlay/detail/ConnectAttempt.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/xrpld/overlay/detail/ConnectAttempt.cpp b/src/xrpld/overlay/detail/ConnectAttempt.cpp index bd0ec8b92f..d5956b6909 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.cpp +++ b/src/xrpld/overlay/detail/ConnectAttempt.cpp @@ -118,14 +118,12 @@ ConnectAttempt::tryAsyncShutdown() strand_.running_in_this_thread(), "ripple::ConnectAttempt::tryAsyncShutdown : strand in this thread"); - if (!shutdown_ || shutdownStarted_) + if (!shutdown_) return; if (ioPending_) return; - shutdownStarted_ = true; - setTimer(); // gracefully shutdown the SSL socket, performing a shutdown handshake @@ -288,7 +286,7 @@ ConnectAttempt::onHandshake(error_code ec) return fail("onHandshake", ec); } - endpoint_type local_endpoint = socket_.local_endpoint(ec); + auto const local_endpoint = socket_.local_endpoint(ec); if (ec) return fail("onHandshake", ec); @@ -320,7 +318,6 @@ ConnectAttempt::onHandshake(error_code ec) return tryAsyncShutdown(); setTimer(); - ioPending_ = true; boost::beast::http::async_write( @@ -460,7 +457,7 @@ ConnectAttempt::processResponse() try { - auto publicKey = verifyHandshake( + auto const publicKey = verifyHandshake( response_, *sharedValue, overlay_.setup().networkID, diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index 8b4cdc05d6..9f0bbf824a 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -61,7 +61,6 @@ private: request_type req_; bool shutdown_ = false; bool ioPending_ = false; - bool shutdownStarted_ = false; public: ConnectAttempt(