26#ifndef ROUTING_CLASSIC_FORWARDING_PROCESSOR_INCLUDED
27#define ROUTING_CLASSIC_FORWARDING_PROCESSOR_INCLUDED
40 using Processor::Processor;
46 std::chrono::milliseconds(100)};
63 bool noflush =
false);
74 bool noflush =
false);
89 const T &msg [[maybe_unused]]) {
150 template <
class Proto>
SSL aware socket buffers.
Definition: channel.h:65
protocol state of a classic protocol connection.
Definition: classic_protocol_state.h:39
classic_protocol::capabilities::value_type shared_capabilities() const
Definition: classic_protocol_state.h:173
a processor base class with helper functions.
Definition: forwarding_processor.h:38
stdx::expected< Processor::Result, std::error_code > reconnect_send_error_msg(TlsSwitchableConnection< Proto > &conn)
Definition: forwarding_processor.h:151
void reconnect_error(classic_protocol::message::server::Error err)
set the reconnect error.
Definition: forwarding_processor.h:161
classic_protocol::message::server::Error reconnect_error() const
get the reconnect error.
Definition: forwarding_processor.h:168
stdx::expected< Processor::Result, std::error_code > mysql_reconnect_start(TraceEvent *parent_event)
reconnect a mysql classic connection.
Definition: forwarding_processor.cc:112
stdx::expected< Processor::Result, std::error_code > reconnect_send_error_msg(Channel &src_channel, ClassicProtocolState &src_protocol)
send a Error msg based on the reconnect_error().
Definition: forwarding_processor.cc:150
stdx::expected< Processor::Result, std::error_code > socket_reconnect_start(TraceEvent *parent_event)
reconnect a socket.
Definition: forwarding_processor.cc:100
static bool message_can_be_forwarded_as_is(ClassicProtocolState &src_protocol, ClassicProtocolState &dst_protocol, const T &msg)
check of the capabilities of the source and the destination are the same for this message.
Definition: forwarding_processor.h:87
stdx::expected< bool, std::error_code > pool_server_connection()
move the server connection to the pool.
Definition: forwarding_processor.cc:59
stdx::expected< Result, std::error_code > forward_client_to_server(bool noflush=false)
forward the current packet from the client-side to the server-side.
Definition: forwarding_processor.cc:51
classic_protocol::message::server::Error reconnect_error_
reconnect error set by lazy_reconnect_start().
Definition: forwarding_processor.h:182
static bool connect_error_is_transient(const classic_protocol::message::server::Error &err)
check if the error is a transient error.
Definition: forwarding_processor.cc:170
stdx::expected< Result, std::error_code > forward_server_to_client(bool noflush=false)
forward the current packet from the server-side to the client-side.
Definition: forwarding_processor.cc:43
stdx::expected< Processor::Result, std::error_code > skip_or_inject_end_of_columns(bool no_flush=false)
adjust the end-of-columns packet.
Definition: forwarding_processor.cc:176
static constexpr const std::chrono::milliseconds kConnectRetryInterval
interval between connect-retries.
Definition: forwarding_processor.h:45
stdx::expected< Result, std::error_code > recv_server_failed_and_check_client_socket(std::error_code ec)
handle error-code of a failed receive() from the server-socket and check the status of the client soc...
Definition: forwarding_processor.cc:124
a processor base class with helper functions.
Definition: processor.h:91
a Connection that can be switched to TLS.
Definition: connection_base.h:264
Channel & channel()
Definition: connection_base.h:359
protocol_state_type & protocol()
Definition: connection_base.h:398
Codec for a type.
Definition: classic_protocol_codec_base.h:72
Definition: expected.h:284
static mi_bit_type mask[]
Definition: mi_packrec.cc:141
borrowable::message::server::Error< false > Error
Definition: classic_protocol_message.h:1411
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:927
Definition: trace_span.h:35