mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix incorrect future returns for pure virtuals
This commit is contained in:
@@ -17,6 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
|
boost::system::error_code SocketBase::pure_virtual_error ()
|
||||||
|
{
|
||||||
|
return boost::system::errc::make_error_code (
|
||||||
|
boost::system::errc::function_not_supported);
|
||||||
|
}
|
||||||
|
|
||||||
void SocketBase::pure_virtual ()
|
void SocketBase::pure_virtual ()
|
||||||
{
|
{
|
||||||
fatal_error ("A beast::Socket function was called on an object that doesn't support the interface");
|
fatal_error ("A beast::Socket function was called on an object that doesn't support the interface");
|
||||||
@@ -25,6 +31,6 @@ void SocketBase::pure_virtual ()
|
|||||||
boost::system::error_code SocketBase::pure_virtual (boost::system::error_code& ec)
|
boost::system::error_code SocketBase::pure_virtual (boost::system::error_code& ec)
|
||||||
{
|
{
|
||||||
pure_virtual ();
|
pure_virtual ();
|
||||||
return ec = boost::system::errc::make_error_code (
|
ec = pure_virtual_error ();
|
||||||
boost::system::errc::function_not_supported);
|
return ec;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,9 @@
|
|||||||
*/
|
*/
|
||||||
struct SocketBase
|
struct SocketBase
|
||||||
{
|
{
|
||||||
static void pure_virtual ();
|
static boost::system::error_code pure_virtual_error ();
|
||||||
static boost::system::error_code pure_virtual (boost::system::error_code& ec);
|
static boost::system::error_code pure_virtual (boost::system::error_code& ec);
|
||||||
|
static void pure_virtual ();
|
||||||
|
|
||||||
/** Called when the underlying object does not support the interface. */
|
/** Called when the underlying object does not support the interface. */
|
||||||
void throw_error (boost::system::error_code const& ec)
|
void throw_error (boost::system::error_code const& ec)
|
||||||
|
|||||||
@@ -394,18 +394,15 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
AcceptHandler, void (error_code)> init(
|
AcceptHandler, void (error_code)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
|
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
AcceptHandler (init.handler), ec));
|
AcceptHandler (init.handler), pure_virtual_error ()));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error ()));
|
||||||
BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler), ec));
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -493,18 +490,15 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
ReadHandler, void (error_code, std::size_t)> init(
|
ReadHandler, void (error_code, std::size_t)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
ReadHandler (init.handler), ec, 0));
|
ReadHandler (init.handler), pure_virtual_error (), 0));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error (), 0));
|
||||||
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler), ec, 0));
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -537,18 +531,15 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
TransferCall, void (error_code, std::size_t)> init(
|
TransferCall, void (error_code, std::size_t)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
|
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
TransferCall (init.handler), ec, 0));
|
TransferCall (init.handler), pure_virtual_error (), 0));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(TransferCall)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error (), 0));
|
||||||
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -619,17 +610,14 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
ErrorCall, void (error_code)> init(
|
ErrorCall, void (error_code)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
|
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
ErrorCall (init.handler), ec));
|
ErrorCall (init.handler), pure_virtual_error ()));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error ()));
|
||||||
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,18 +674,15 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
TransferCall, void (error_code, std::size_t)> init(
|
TransferCall, void (error_code, std::size_t)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
|
BOOST_ASIO_MOVE_CAST(TransferCall)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
TransferCall (init.handler), ec, 0));
|
TransferCall (init.handler), pure_virtual_error (), 0));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(TransferCall)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error (), 0));
|
||||||
BOOST_ASIO_MOVE_CAST(TransferCall)(handler), ec, 0));
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -753,18 +738,15 @@ public:
|
|||||||
boost::asio::detail::async_result_init<
|
boost::asio::detail::async_result_init<
|
||||||
ErrorCall, void (error_code, std::size_t)> init(
|
ErrorCall, void (error_code, std::size_t)> init(
|
||||||
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
|
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler));
|
||||||
error_code ec;
|
|
||||||
ec = pure_virtual (ec);
|
|
||||||
// init.handler is copied
|
// init.handler is copied
|
||||||
get_io_service ().post (CompletionCall (
|
get_io_service ().post (CompletionCall (
|
||||||
ErrorCall (init.handler), ec));
|
ErrorCall (init.handler), pure_virtual_error ()));
|
||||||
return init.result.get();
|
return init.result.get();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
error_code ec;
|
get_io_service ().post (CompletionCall (
|
||||||
ec = pure_virtual (ec);
|
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler),
|
||||||
get_io_service ().post (boost::bind (
|
pure_virtual_error ()));
|
||||||
BOOST_ASIO_MOVE_CAST(ErrorCall)(handler), ec));
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user