adds missing writePending flag

This commit is contained in:
Vito
2025-09-04 15:34:04 +02:00
parent 273e8b5365
commit d68ca81b71
3 changed files with 6 additions and 4 deletions

View File

@@ -210,7 +210,7 @@ ConnectAttempt::setTimer()
{
try
{
timer_.expires_after(connectTimeout_);
timer_.expires_after(connectTimeout);
}
catch (std::exception const& ex)
{

View File

@@ -46,7 +46,8 @@ private:
using stream_type = boost::beast::ssl_stream<middle_type>;
using shared_context = std::shared_ptr<boost::asio::ssl::context>;
std::chrono::seconds const connectTimeout_{15};
static constexpr std::chrono::seconds connectTimeout{15};
Application& app_;
std::uint32_t const id_;
beast::WrappedSink sink_;

View File

@@ -289,6 +289,7 @@ PeerImp::send(std::shared_ptr<Message> 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)