File indexing completed on 2025-09-15 08:42:57
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_MYSQL_IMPL_INTERNAL_SANSIO_RESET_CONNECTION_HPP
0009 #define BOOST_MYSQL_IMPL_INTERNAL_SANSIO_RESET_CONNECTION_HPP
0010
0011 #include <boost/mysql/diagnostics.hpp>
0012 #include <boost/mysql/error_code.hpp>
0013
0014 #include <boost/mysql/detail/algo_params.hpp>
0015
0016 #include <boost/mysql/impl/internal/coroutine.hpp>
0017 #include <boost/mysql/impl/internal/protocol/deserialization.hpp>
0018 #include <boost/mysql/impl/internal/protocol/serialization.hpp>
0019 #include <boost/mysql/impl/internal/sansio/connection_state_data.hpp>
0020
0021 namespace boost {
0022 namespace mysql {
0023 namespace detail {
0024
0025 class read_reset_connection_response_algo
0026 {
0027 int resume_point_{0};
0028 std::uint8_t seqnum_{0};
0029
0030 public:
0031 read_reset_connection_response_algo(std::uint8_t seqnum) noexcept : seqnum_(seqnum) {}
0032
0033 next_action resume(connection_state_data& st, diagnostics& diag, error_code ec)
0034 {
0035 switch (resume_point_)
0036 {
0037 case 0:
0038
0039
0040 BOOST_MYSQL_YIELD(resume_point_, 1, st.read(seqnum_))
0041 if (ec)
0042 return ec;
0043
0044
0045 ec = st.deserialize_ok(diag);
0046 if (!ec)
0047 {
0048
0049
0050
0051 st.current_charset = character_set{};
0052 }
0053
0054
0055 }
0056
0057 return ec;
0058 }
0059 };
0060
0061 inline run_pipeline_algo_params setup_reset_connection_pipeline(connection_state_data& st)
0062 {
0063
0064 st.write_buffer.clear();
0065 st.shared_pipeline_stages[0] = {
0066 pipeline_stage_kind::reset_connection,
0067 serialize_top_level_checked(reset_connection_command{}, st.write_buffer),
0068 {}
0069 };
0070 return {
0071 st.write_buffer,
0072 {st.shared_pipeline_stages.data(), 1},
0073 nullptr
0074 };
0075 }
0076
0077 }
0078 }
0079 }
0080
0081 #endif