From 4d57d2db085814129eb008a262ea2acf4cd74394 Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Fri, 7 Oct 2022 23:25:03 +0200 Subject: [PATCH] Renamed conenction_params => async_params --- include/boost/mysql/connection.hpp | 18 +++++++++--------- .../detail/network_algorithms/connect.hpp | 6 +++--- .../detail/network_algorithms/handshake.hpp | 6 +++--- .../detail/network_algorithms/impl/connect.hpp | 8 ++++---- .../network_algorithms/impl/handshake.hpp | 12 ++++++------ ...nection_params.hpp => handshake_params.hpp} | 8 ++++---- include/boost/mysql/impl/connection.hpp | 12 ++++++------ test/common/test_common.hpp | 2 +- test/integration/handshake.cpp | 2 +- test/integration/reconnect.cpp | 2 +- .../utils/include/er_connection.hpp | 2 +- .../utils/include/integration_test_common.hpp | 2 +- test/integration/utils/src/async_callback.cpp | 2 +- .../utils/src/async_callback_noerrinfo.cpp | 2 +- test/integration/utils/src/async_coroutine.cpp | 2 +- .../utils/src/async_coroutinecpp20.cpp | 2 +- test/integration/utils/src/async_future.cpp | 2 +- .../utils/src/default_completion_tokens.cpp | 2 +- test/integration/utils/src/sync_errc.cpp | 2 +- test/integration/utils/src/sync_exc.cpp | 2 +- test/unit/connection.cpp | 9 ++++++--- 21 files changed, 54 insertions(+), 51 deletions(-) rename include/boost/mysql/{connection_params.hpp => handshake_params.hpp} (96%) diff --git a/include/boost/mysql/connection.hpp b/include/boost/mysql/connection.hpp index 0bfbb2c1..d1ef0e2e 100644 --- a/include/boost/mysql/connection.hpp +++ b/include/boost/mysql/connection.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #endif @@ -165,7 +165,7 @@ public: template void connect( const EndpointType& endpoint, - const connection_params& params, + const handshake_params& params, error_code& ec, error_info& info ); @@ -185,7 +185,7 @@ public: template void connect( const EndpointType& endpoint, - const connection_params& params + const handshake_params& params ); /** @@ -216,7 +216,7 @@ public: BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_connect( const EndpointType& endpoint, - const connection_params& params, + const handshake_params& params, CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type) ) { @@ -251,7 +251,7 @@ public: BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_connect( const EndpointType& endpoint, - const connection_params& params, + const handshake_params& params, error_info& output_info, CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type) ); @@ -265,7 +265,7 @@ public: * If using a SSL-capable stream, the SSL handshake will be performed by this function. * See [link mysql.ssl.handshake this section] for more info. */ - void handshake(const connection_params& params, error_code& ec, error_info& info); + void handshake(const handshake_params& params, error_code& ec, error_info& info); /** * \brief Performs the MySQL-level handshake (sync with exceptions version). @@ -276,7 +276,7 @@ public: * If using a SSL-capable stream, the SSL handshake will be performed by this function. * See [link mysql.ssl.handshake this section] for more info. */ - void handshake(const connection_params& params); + void handshake(const handshake_params& params); /** * \brief Performs the MySQL-level handshake @@ -299,7 +299,7 @@ public: > BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_handshake( - const connection_params& params, + const handshake_params& params, CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type) ) { @@ -327,7 +327,7 @@ public: > BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_handshake( - const connection_params& params, + const handshake_params& params, error_info& output_info, CompletionToken&& token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type) ); diff --git a/include/boost/mysql/detail/network_algorithms/connect.hpp b/include/boost/mysql/detail/network_algorithms/connect.hpp index a472c00d..6141b1cc 100644 --- a/include/boost/mysql/detail/network_algorithms/connect.hpp +++ b/include/boost/mysql/detail/network_algorithms/connect.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP -#include +#include #include #include @@ -20,7 +20,7 @@ template void connect( channel& chan, const typename Stream::lowest_layer_type::endpoint_type& endpoint, - const connection_params& params, + const handshake_params& params, error_code& err, error_info& info ); @@ -30,7 +30,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_connect( channel& chan, const typename Stream::lowest_layer_type::endpoint_type& endpoint, - const connection_params& params, + const handshake_params& params, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/handshake.hpp b/include/boost/mysql/detail/network_algorithms/handshake.hpp index fcc80313..635c7012 100644 --- a/include/boost/mysql/detail/network_algorithms/handshake.hpp +++ b/include/boost/mysql/detail/network_algorithms/handshake.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace boost { @@ -20,7 +20,7 @@ namespace detail { template void handshake( channel& channel, - const connection_params& params, + const handshake_params& params, error_code& err, error_info& info ); @@ -29,7 +29,7 @@ template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_handshake( channel& channel, - const connection_params& params, + const handshake_params& params, error_info& info, CompletionToken&& token ); diff --git a/include/boost/mysql/detail/network_algorithms/impl/connect.hpp b/include/boost/mysql/detail/network_algorithms/impl/connect.hpp index 16379893..cac69bf9 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/connect.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/connect.hpp @@ -25,13 +25,13 @@ struct connect_op : boost::asio::coroutine channel& chan_; error_info& output_info_; endpoint_type ep_; - connection_params params_; + handshake_params params_; connect_op( channel& chan, error_info& output_info, const endpoint_type& ep, - const connection_params& params + const handshake_params& params ) : chan_(chan), output_info_(output_info), @@ -82,7 +82,7 @@ template void boost::mysql::detail::connect( channel& chan, const typename Stream::lowest_layer_type::endpoint_type& endpoint, - const connection_params& params, + const handshake_params& params, error_code& err, error_info& info ) @@ -109,7 +109,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( boost::mysql::detail::async_connect( channel& chan, const typename Stream::lowest_layer_type::endpoint_type& endpoint, - const connection_params& params, + const handshake_params& params, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp b/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp index 2f3704d4..1047f6c4 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/handshake.hpp @@ -78,13 +78,13 @@ enum class auth_result class handshake_processor { - connection_params params_; + handshake_params params_; capabilities negotiated_caps_; auth_calculator auth_calc_; public: - handshake_processor(const connection_params& params): params_(params) {}; + handshake_processor(const handshake_params& params): params_(params) {}; capabilities negotiated_capabilities() const noexcept { return negotiated_caps_; } - const connection_params& params() const noexcept { return params_; } + const handshake_params& params() const noexcept { return params_; } bool use_ssl() const noexcept { return negotiated_caps_.has(CLIENT_SSL); } // Initial greeting processing @@ -260,7 +260,7 @@ struct handshake_op : boost::asio::coroutine handshake_op( channel& channel, error_info& output_info, - const connection_params& params + const handshake_params& params ) : chan_(channel), output_info_(output_info), @@ -354,7 +354,7 @@ struct handshake_op : boost::asio::coroutine template void boost::mysql::detail::handshake( channel& channel, - const connection_params& params, + const handshake_params& params, error_code& err, error_info& info ) @@ -427,7 +427,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( ) boost::mysql::detail::async_handshake( channel& chan, - const connection_params& params, + const handshake_params& params, error_info& info, CompletionToken&& token ) diff --git a/include/boost/mysql/connection_params.hpp b/include/boost/mysql/handshake_params.hpp similarity index 96% rename from include/boost/mysql/connection_params.hpp rename to include/boost/mysql/handshake_params.hpp index a56c7458..94d4b3db 100644 --- a/include/boost/mysql/connection_params.hpp +++ b/include/boost/mysql/handshake_params.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_MYSQL_CONNECTION_PARAMS_HPP -#define BOOST_MYSQL_CONNECTION_PARAMS_HPP +#ifndef BOOST_MYSQL_HANDSHAKE_PARAMS_HPP +#define BOOST_MYSQL_HANDSHAKE_PARAMS_HPP #include #include @@ -33,7 +33,7 @@ enum class ssl_mode * with a MySQL server. See [link mysql.connparams this section] * for more information on each parameter. */ -class connection_params +class handshake_params { boost::string_view username_; boost::string_view password_; @@ -50,7 +50,7 @@ public: * Impacts how text queries and prepared statements are interpreted. Defaults to utf8_general_ci. * \param mode The [reflink ssl_mode] to use with this connection; ignored if the connection does not support SSL. */ - connection_params( + handshake_params( boost::string_view username, boost::string_view password, boost::string_view db = "", diff --git a/include/boost/mysql/impl/connection.hpp b/include/boost/mysql/impl/connection.hpp index 28c5a108..59dc504d 100644 --- a/include/boost/mysql/impl/connection.hpp +++ b/include/boost/mysql/impl/connection.hpp @@ -29,7 +29,7 @@ template template void boost::mysql::connection::connect( const EndpointType& endpoint, - const connection_params& params, + const handshake_params& params, error_code& ec, error_info& info ) @@ -42,7 +42,7 @@ template template void boost::mysql::connection::connect( const EndpointType& endpoint, - const connection_params& params + const handshake_params& params ) { detail::error_block blk; @@ -61,7 +61,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( ) boost::mysql::connection::async_connect( const EndpointType& endpoint, - const connection_params& params, + const handshake_params& params, error_info& output_info, CompletionToken&& token ) @@ -80,7 +80,7 @@ boost::mysql::connection::async_connect( // handshake template void boost::mysql::connection::handshake( - const connection_params& params, + const handshake_params& params, error_code& code, error_info& info ) @@ -91,7 +91,7 @@ void boost::mysql::connection::handshake( template void boost::mysql::connection::handshake( - const connection_params& params + const handshake_params& params ) { detail::error_block blk; @@ -106,7 +106,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( void(boost::mysql::error_code) ) boost::mysql::connection::async_handshake( - const connection_params& params, + const handshake_params& params, error_info& output_info, CompletionToken&& token ) diff --git a/test/common/test_common.hpp b/test/common/test_common.hpp index 0171c8c0..77f43356 100644 --- a/test/common/test_common.hpp +++ b/test/common/test_common.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/integration/handshake.cpp b/test/integration/handshake.cpp index a604553b..260b8ace 100644 --- a/test/integration/handshake.cpp +++ b/test/integration/handshake.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include "boost/mysql/errc.hpp" #include "er_network_variant.hpp" diff --git a/test/integration/reconnect.cpp b/test/integration/reconnect.cpp index 5a8a0257..553e6b6e 100644 --- a/test/integration/reconnect.cpp +++ b/test/integration/reconnect.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "integration_test_common.hpp" diff --git a/test/integration/utils/include/er_connection.hpp b/test/integration/utils/include/er_connection.hpp index b0675684..8fd710d2 100644 --- a/test/integration/utils/include/er_connection.hpp +++ b/test/integration/utils/include/er_connection.hpp @@ -13,7 +13,7 @@ #include "er_endpoint.hpp" #include "er_resultset.hpp" #include "er_statement.hpp" -#include +#include #include diff --git a/test/integration/utils/include/integration_test_common.hpp b/test/integration/utils/include/integration_test_common.hpp index d0d03cc8..a7ea1750 100644 --- a/test/integration/utils/include/integration_test_common.hpp +++ b/test/integration/utils/include/integration_test_common.hpp @@ -12,7 +12,7 @@ #include #include #include -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "test_common.hpp" #include "metadata_validator.hpp" #include "network_test.hpp" diff --git a/test/integration/utils/src/async_callback.cpp b/test/integration/utils/src/async_callback.cpp index 07b16a69..3ff7e8ae 100644 --- a/test/integration/utils/src/async_callback.cpp +++ b/test/integration/utils/src/async_callback.cpp @@ -14,7 +14,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/async_callback_noerrinfo.cpp b/test/integration/utils/src/async_callback_noerrinfo.cpp index 06e0dedc..137a9794 100644 --- a/test/integration/utils/src/async_callback_noerrinfo.cpp +++ b/test/integration/utils/src/async_callback_noerrinfo.cpp @@ -14,7 +14,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/async_coroutine.cpp b/test/integration/utils/src/async_coroutine.cpp index c36af2eb..107c58ff 100644 --- a/test/integration/utils/src/async_coroutine.cpp +++ b/test/integration/utils/src/async_coroutine.cpp @@ -14,7 +14,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/async_coroutinecpp20.cpp b/test/integration/utils/src/async_coroutinecpp20.cpp index 41f331c3..cc75a5db 100644 --- a/test/integration/utils/src/async_coroutinecpp20.cpp +++ b/test/integration/utils/src/async_coroutinecpp20.cpp @@ -15,7 +15,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/async_future.cpp b/test/integration/utils/src/async_future.cpp index 3869e9e0..568bcb04 100644 --- a/test/integration/utils/src/async_future.cpp +++ b/test/integration/utils/src/async_future.cpp @@ -14,7 +14,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/default_completion_tokens.cpp b/test/integration/utils/src/default_completion_tokens.cpp index 0cab981d..a94323b0 100644 --- a/test/integration/utils/src/default_completion_tokens.cpp +++ b/test/integration/utils/src/default_completion_tokens.cpp @@ -14,7 +14,7 @@ #include "er_impl_common.hpp" #include "get_endpoint.hpp" #include "handler_call_tracker.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/sync_errc.cpp b/test/integration/utils/src/sync_errc.cpp index 423540c2..90a60eef 100644 --- a/test/integration/utils/src/sync_errc.cpp +++ b/test/integration/utils/src/sync_errc.cpp @@ -13,7 +13,7 @@ #include "streams.hpp" #include "er_impl_common.hpp" #include "get_endpoint.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/integration/utils/src/sync_exc.cpp b/test/integration/utils/src/sync_exc.cpp index d7461ebc..535773ae 100644 --- a/test/integration/utils/src/sync_exc.cpp +++ b/test/integration/utils/src/sync_exc.cpp @@ -13,7 +13,7 @@ #include "streams.hpp" #include "er_impl_common.hpp" #include "get_endpoint.hpp" -#include "boost/mysql/connection_params.hpp" +#include "boost/mysql/handshake_params.hpp" #include "boost/mysql/errc.hpp" #include "boost/mysql/error.hpp" #include "boost/mysql/execute_params.hpp" diff --git a/test/unit/connection.cpp b/test/unit/connection.cpp index 92c3866b..fae571b4 100644 --- a/test/unit/connection.cpp +++ b/test/unit/connection.cpp @@ -6,13 +6,14 @@ // #include -#include -#include "test_stream.hpp" -#include #include +#include "test_stream.hpp" using conn_t = boost::mysql::connection; +namespace +{ + BOOST_AUTO_TEST_SUITE(test_connection) // init ctor @@ -97,3 +98,5 @@ BOOST_AUTO_TEST_CASE(connection_rebind_executor) } BOOST_AUTO_TEST_SUITE_END() // test_connection + +}