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:40
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:1769
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:2134
stdx::expected< Result, std::error_code > client_greeting()
Definition: classic_greeting_forwarder.cc:1482
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:2170
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:1836
stdx::expected< Result, std::error_code > fetch_user_attrs_done()
Definition: classic_greeting_forwarder.cc:2183
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:1432
stdx::expected< Result, std::error_code > client_greeting_full()
Definition: classic_greeting_forwarder.cc:1643
stdx::expected< Result, std::error_code > process() override
Definition: classic_greeting_forwarder.cc:1387
stdx::expected< Result, std::error_code > tls_forward_init()
Definition: classic_greeting_forwarder.cc:1815
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:1880
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:1565
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:2104
stdx::expected< Result, std::error_code > initial_response()
Definition: classic_greeting_forwarder.cc:2042
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:2058
stdx::expected< Result, std::error_code > client_greeting_after_tls()
Definition: classic_greeting_forwarder.cc:1972
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:1343
stdx::expected< Result, std::error_code > process() override
Definition: classic_greeting_forwarder.cc:1274
Stage stage() const
Definition: classic_greeting_forwarder.h:178
stdx::expected< Result, std::error_code > server_greeting()
Definition: classic_greeting_forwarder.cc:1302
Stage stage_
Definition: classic_greeting_forwarder.h:185
stdx::expected< Result, std::error_code > connect()
Definition: classic_greeting_forwarder.cc:1295
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:352
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:732
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:308
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:795
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:411
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:503
stdx::expected< Result, std::error_code > client_greeting()
Definition: classic_greeting_forwarder.cc:626
stdx::expected< Result, std::error_code > initial_response()
Definition: classic_greeting_forwarder.cc:1134
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:1234
stdx::expected< Result, std::error_code > server_greeting()
Definition: classic_greeting_forwarder.cc:379
stdx::expected< Result, std::error_code > auth_error()
router<-server: auth error.
Definition: classic_greeting_forwarder.cc:1198
stdx::expected< Result, std::error_code > final_response()
Definition: classic_greeting_forwarder.cc:1153
void client_greeting_server_adjust_caps(ClassicProtocolState &src_protocol, ClassicProtocolState &dst_protocol)
Definition: classic_greeting_forwarder.cc:449
Definition: expected.h:286
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:908
Definition: gcs_xcom_synode.h:64
Definition: trace_span.h:35