From d68ca81b71d4af87daf7e756dc275e2ea03c6dc1 Mon Sep 17 00:00:00 2001 From: Vito <5780819+Tapanito@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:34:04 +0200 Subject: [PATCH] adds missing writePending flag --- src/xrpld/overlay/detail/ConnectAttempt.cpp | 2 +- src/xrpld/overlay/detail/ConnectAttempt.h | 3 ++- src/xrpld/overlay/detail/PeerImp.cpp | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xrpld/overlay/detail/ConnectAttempt.cpp b/src/xrpld/overlay/detail/ConnectAttempt.cpp index d43569bda3..2555221f1f 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.cpp +++ b/src/xrpld/overlay/detail/ConnectAttempt.cpp @@ -210,7 +210,7 @@ ConnectAttempt::setTimer() { try { - timer_.expires_after(connectTimeout_); + timer_.expires_after(connectTimeout); } catch (std::exception const& ex) { diff --git a/src/xrpld/overlay/detail/ConnectAttempt.h b/src/xrpld/overlay/detail/ConnectAttempt.h index 28da27a6e0..9884a5b725 100644 --- a/src/xrpld/overlay/detail/ConnectAttempt.h +++ b/src/xrpld/overlay/detail/ConnectAttempt.h @@ -46,7 +46,8 @@ private: using stream_type = boost::beast::ssl_stream; using shared_context = std::shared_ptr; - std::chrono::seconds const connectTimeout_{15}; + static constexpr std::chrono::seconds connectTimeout{15}; + Application& app_; std::uint32_t const id_; beast::WrappedSink sink_; diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 5aa1f5f2b5..31e81cb9a9 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -289,6 +289,7 @@ PeerImp::send(std::shared_ptr const& m) if (sendq_size != 0) return; + writePending_ = true; boost::asio::async_write( stream_, boost::asio::buffer( @@ -648,7 +649,7 @@ PeerImp::shutdown() strand_.running_in_this_thread(), "ripple::PeerImp::shutdown: strand in this thread"); - if (!socket_.is_open()) + if (!socket_.is_open() || shutdown_) return; shutdown_ = true; @@ -656,7 +657,7 @@ PeerImp::shutdown() boost::beast::get_lowest_layer(stream_).cancel(); tryAsyncShutdown(); -}; +} void PeerImp::onShutdown(error_code ec)