mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 22:30:57 +00:00
Remove workaround for waitable timers (#3166)
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2019 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_BEAST_ASIO_WAITABLETIMER_H_INCLUDED
|
||||
#define RIPPLE_BEAST_ASIO_WAITABLETIMER_H_INCLUDED
|
||||
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
|
||||
namespace beast {
|
||||
|
||||
// Pre boost 1.70, a waitable timer may only be created from an io_context.
|
||||
// However, post 1.70, the `get_io_service` function is deleted. Post
|
||||
// boost 1.70, a waitable time may be created from an executor. This functions
|
||||
// allows a waitable timer to be created from a socket in both pre and post
|
||||
// boost 1.70 versions
|
||||
template <class T>
|
||||
T
|
||||
create_waitable_timer(boost::asio::ip::tcp::socket& socket)
|
||||
{
|
||||
#if BOOST_VERSION >= 107000
|
||||
return T{socket.get_executor()};
|
||||
#else
|
||||
return T{socket.get_io_service()};
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ PeerImp::PeerImp (Application& app, id_t id,
|
||||
, socket_ (ssl_bundle_->socket)
|
||||
, stream_ (ssl_bundle_->stream)
|
||||
, strand_ (socket_.get_executor())
|
||||
, timer_ (beast::create_waitable_timer<waitable_timer>(socket_))
|
||||
, timer_ (waitable_timer{socket_.get_executor()})
|
||||
, remote_address_ (slot->remote_endpoint())
|
||||
, overlay_ (overlay)
|
||||
, m_inbound (true)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <ripple/app/consensus/RCLCxPeerPos.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/RangeSet.h>
|
||||
#include <ripple/beast/asio/waitable_timer.h>
|
||||
#include <ripple/beast/utility/WrappedSink.h>
|
||||
#include <ripple/overlay/impl/ProtocolMessage.h>
|
||||
#include <ripple/overlay/impl/ProtocolVersion.h>
|
||||
@@ -558,7 +557,7 @@ PeerImp::PeerImp (Application& app, std::unique_ptr<beast::asio::ssl_bundle>&& s
|
||||
, socket_ (ssl_bundle_->socket)
|
||||
, stream_ (ssl_bundle_->stream)
|
||||
, strand_ (socket_.get_executor())
|
||||
, timer_ (beast::create_waitable_timer<waitable_timer>(socket_))
|
||||
, timer_ (waitable_timer{socket_.get_executor()})
|
||||
, remote_address_ (slot->remote_endpoint())
|
||||
, overlay_ (overlay)
|
||||
, m_inbound (false)
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define RIPPLE_SERVER_PLAINWSPEER_H_INCLUDED
|
||||
|
||||
#include <ripple/server/impl/BaseWSPeer.h>
|
||||
#include <ripple/beast/asio/waitable_timer.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
@@ -68,7 +67,7 @@ PlainWSPeer<Handler>::PlainWSPeer(
|
||||
port,
|
||||
handler,
|
||||
socket.get_executor(),
|
||||
beast::create_waitable_timer<waitable_timer>(socket),
|
||||
waitable_timer{socket.get_executor()},
|
||||
remote_address,
|
||||
std::move(request),
|
||||
journal)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <ripple/server/impl/BaseHTTPPeer.h>
|
||||
#include <ripple/server/impl/SSLWSPeer.h>
|
||||
#include <ripple/beast/asio/ssl_bundle.h>
|
||||
#include <ripple/beast/asio/waitable_timer.h>
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <ripple/server/impl/BaseHTTPPeer.h>
|
||||
#include <ripple/server/WSSession.h>
|
||||
#include <ripple/beast/asio/ssl_bundle.h>
|
||||
#include <ripple/beast/asio/waitable_timer.h>
|
||||
#include <boost/beast/websocket/ssl.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -74,7 +73,7 @@ SSLWSPeer<Handler>::SSLWSPeer(
|
||||
port,
|
||||
handler,
|
||||
ssl_bundle->socket.get_executor(),
|
||||
beast::create_waitable_timer<waitable_timer>(ssl_bundle->socket),
|
||||
waitable_timer{ssl_bundle->socket.get_executor()},
|
||||
remote_endpoint,
|
||||
std::move(request),
|
||||
journal)
|
||||
|
||||
Reference in New Issue
Block a user