Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-09 08:28:00

0001 //
0002 // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MYSQL_DETAIL_CONNECT_PARAMS_HELPERS_HPP
0009 #define BOOST_MYSQL_DETAIL_CONNECT_PARAMS_HELPERS_HPP
0010 
0011 #include <boost/mysql/any_address.hpp>
0012 #include <boost/mysql/connect_params.hpp>
0013 #include <boost/mysql/handshake_params.hpp>
0014 #include <boost/mysql/ssl_mode.hpp>
0015 
0016 namespace boost {
0017 namespace mysql {
0018 namespace detail {
0019 
0020 inline ssl_mode adjust_ssl_mode(ssl_mode input, address_type addr_type)
0021 {
0022     return addr_type == address_type::host_and_port ? input : ssl_mode::disable;
0023 }
0024 
0025 inline handshake_params make_hparams(const connect_params& input)
0026 {
0027     return handshake_params(
0028         input.username,
0029         input.password,
0030         input.database,
0031         input.connection_collation,
0032         adjust_ssl_mode(input.ssl, input.server_address.type()),
0033         input.multi_queries
0034     );
0035 }
0036 
0037 }  // namespace detail
0038 }  // namespace mysql
0039 }  // namespace boost
0040 
0041 #endif