26#ifndef ROUTING_CLASSIC_GREETING_FORWARDER_INCLUDED
27#define ROUTING_CLASSIC_GREETING_FORWARDER_INCLUDED
104 const std::optional<classic_protocol::message::server::Error> &
err) {
108 std::optional<classic_protocol::message::server::Error>
failed()
const {
135 std::optional<classic_protocol::message::server::Error>
failed_;
161 using ForwardingProcessor::ForwardingProcessor;
189 std::chrono::steady_clock::now()};
237 const std::optional<classic_protocol::message::server::Error> &
err) {
241 std::optional<classic_protocol::message::server::Error>
failed()
const {
269 std::optional<classic_protocol::message::server::Error>
failed_;
protocol state of a classic protocol connection.
Definition: classic_protocol_state.h:39
a processor base class with helper functions.
Definition: forwarding_processor.h:38
Definition: classic_connection_base.h:56
authenticates a server connection.
Definition: classic_greeting_forwarder.h:200
void failed(const std::optional< classic_protocol::message::server::Error > &err)
Definition: classic_greeting_forwarder.h:236
stdx::expected< Result, std::error_code > tls_forward()
Definition: classic_greeting_forwarder.cc:1765
size_t server_last_recv_buf_size_
Definition: classic_greeting_forwarder.h:266
size_t server_last_send_buf_size_
Definition: classic_greeting_forwarder.h:267
RouterRequireFetcher::Result required_connection_attributes_fetcher_result_
Definition: classic_greeting_forwarder.h:271
stdx::expected< Result, std::error_code > auth_ok()
server-side: auth is ok.
Definition: classic_greeting_forwarder.cc:2127
stdx::expected< Result, std::error_code > client_greeting()
Definition: classic_greeting_forwarder.cc:1479
size_t client_last_send_buf_size_
Definition: classic_greeting_forwarder.h:265
stdx::expected< Result, std::error_code > fetch_user_attrs()
Definition: classic_greeting_forwarder.cc:2163
std::optional< classic_protocol::message::server::Error > failed() const
Definition: classic_greeting_forwarder.h:241
stdx::expected< Result, std::error_code > tls_connect_init()
Definition: classic_greeting_forwarder.cc:1832
stdx::expected< Result, std::error_code > fetch_user_attrs_done()
Definition: classic_greeting_forwarder.cc:2176
Stage stage_
Definition: classic_greeting_forwarder.h:273
void client_greeting_server_adjust_caps(ClassicProtocolState &rc_protocol, ClassicProtocolState &st_protocol)
Definition: classic_greeting_forwarder.cc:1429
stdx::expected< Result, std::error_code > client_greeting_full()
Definition: classic_greeting_forwarder.cc:1640
stdx::expected< Result, std::error_code > process() override
Definition: classic_greeting_forwarder.cc:1384
stdx::expected< Result, std::error_code > tls_forward_init()
Definition: classic_greeting_forwarder.cc:1811
std::optional< classic_protocol::message::server::Error > failed_
Definition: classic_greeting_forwarder.h:269
stdx::expected< Result, std::error_code > tls_connect()
Definition: classic_greeting_forwarder.cc:1876
Stage stage() const
Definition: classic_greeting_forwarder.h:234
ServerFirstAuthenticator(MysqlRoutingClassicConnectionBase *conn, std::function< void(const classic_protocol::message::server::Error &)> on_error)
Definition: classic_greeting_forwarder.h:202
stdx::expected< Result, std::error_code > client_greeting_start_tls()
Definition: classic_greeting_forwarder.cc:1562
Stage
stages of the handshake flow.
Definition: classic_greeting_forwarder.h:211
stdx::expected< Result, std::error_code > auth_error()
router<-server: auth error.
Definition: classic_greeting_forwarder.cc:2097
stdx::expected< Result, std::error_code > initial_response()
Definition: classic_greeting_forwarder.cc:2037
size_t client_last_recv_buf_size_
Definition: classic_greeting_forwarder.h:264
stdx::expected< Result, std::error_code > final_response()
Definition: classic_greeting_forwarder.cc:2051
stdx::expected< Result, std::error_code > client_greeting_after_tls()
Definition: classic_greeting_forwarder.cc:1968
void stage(Stage stage)
Definition: classic_greeting_forwarder.h:233
std::function< void(const classic_protocol::message::server::Error &err)> on_error_
Definition: classic_greeting_forwarder.h:276
classic protocol handshake between router<->server and client<->router.
Definition: classic_greeting_forwarder.h:159
stdx::expected< Result, std::error_code > server_greeted()
received an server::greeting or server::error from the server.
Definition: classic_greeting_forwarder.cc:1340
stdx::expected< Result, std::error_code > process() override
Definition: classic_greeting_forwarder.cc:1271
Stage stage() const
Definition: classic_greeting_forwarder.h:178
stdx::expected< Result, std::error_code > server_greeting()
Definition: classic_greeting_forwarder.cc:1299
Stage stage_
Definition: classic_greeting_forwarder.h:185
stdx::expected< Result, std::error_code > connect()
Definition: classic_greeting_forwarder.cc:1292
std::chrono::steady_clock::time_point started_
Definition: classic_greeting_forwarder.h:188
void stage(Stage stage)
Definition: classic_greeting_forwarder.h:177
Stage
stages of the handshake flow.
Definition: classic_greeting_forwarder.h:166
classic protocol handshake between client<->router and router<->server.
Definition: classic_greeting_forwarder.h:36
stdx::expected< Result, std::error_code > error()
Definition: classic_greeting_forwarder.cc:353
ServerGreetor(MysqlRoutingClassicConnectionBase *conn, bool in_handshake, std::function< void(const classic_protocol::message::server::Error &)> on_error, TraceEvent *parent_event)
construct a server::greeting processor.
Definition: classic_greeting_forwarder.h:62
void stage(Stage stage)
Definition: classic_greeting_forwarder.h:100
void failed(const std::optional< classic_protocol::message::server::Error > &err)
Definition: classic_greeting_forwarder.h:103
stdx::expected< Result, std::error_code > client_greeting_start_tls()
Definition: classic_greeting_forwarder.cc:733
stdx::expected< Result, std::error_code > client_greeting_after_tls()
a TLS client greeting.
Definition: classic_greeting_forwarder.cc:1046
bool in_handshake_
Definition: classic_greeting_forwarder.h:131
stdx::expected< Result, std::error_code > process() override
Definition: classic_greeting_forwarder.cc:309
stdx::expected< Result, std::error_code > tls_connect_init()
Definition: classic_greeting_forwarder.cc:889
TraceEvent * trace_event_server_greeting_
Definition: classic_greeting_forwarder.h:142
TraceEvent * trace_event_greeting_
Definition: classic_greeting_forwarder.h:141
stdx::expected< Result, std::error_code > client_greeting_full()
send a non-TLS client greeting to the server.
Definition: classic_greeting_forwarder.cc:796
std::optional< classic_protocol::message::server::Error > failed() const
Definition: classic_greeting_forwarder.h:108
stdx::expected< Result, std::error_code > server_greeting_error()
received an server::error from the server.
Definition: classic_greeting_forwarder.cc:412
std::function< void(const classic_protocol::message::server::Error &err)> on_error_
Definition: classic_greeting_forwarder.h:138
Stage stage() const
Definition: classic_greeting_forwarder.h:101
stdx::expected< Result, std::error_code > server_greeting_greeting()
received a server::greeting from the server.
Definition: classic_greeting_forwarder.cc:504
stdx::expected< Result, std::error_code > client_greeting()
Definition: classic_greeting_forwarder.cc:627
stdx::expected< Result, std::error_code > initial_response()
Definition: classic_greeting_forwarder.cc:1133
TraceEvent * parent_event_
Definition: classic_greeting_forwarder.h:140
TraceEvent * trace_event_client_greeting_
Definition: classic_greeting_forwarder.h:143
stdx::expected< Result, std::error_code > tls_connect()
Definition: classic_greeting_forwarder.cc:937
Stage
stages of the handshake flow.
Definition: classic_greeting_forwarder.h:78
Stage stage_
Definition: classic_greeting_forwarder.h:133
std::optional< classic_protocol::message::server::Error > failed_
Definition: classic_greeting_forwarder.h:135
TraceEvent * trace_event_tls_connect_
Definition: classic_greeting_forwarder.h:144
stdx::expected< Result, std::error_code > auth_ok()
server-side: auth is ok.
Definition: classic_greeting_forwarder.cc:1231
stdx::expected< Result, std::error_code > server_greeting()
Definition: classic_greeting_forwarder.cc:380
stdx::expected< Result, std::error_code > auth_error()
router<-server: auth error.
Definition: classic_greeting_forwarder.cc:1195
stdx::expected< Result, std::error_code > final_response()
Definition: classic_greeting_forwarder.cc:1150
void client_greeting_server_adjust_caps(ClassicProtocolState &src_protocol, ClassicProtocolState &dst_protocol)
Definition: classic_greeting_forwarder.cc:450
Definition: expected.h:284
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: gcs_xcom_synode.h:64
Definition: trace_span.h:35