MySQL 8.0.41
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
classic_connection_base.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2020, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ROUTING_CLASSIC_CONNECTION_BASE_INCLUDED
27#define ROUTING_CLASSIC_CONNECTION_BASE_INCLUDED
28
29#include <functional>
30#include <memory>
31#include <optional>
32#include <string>
33#include <unordered_map>
34#include <vector>
35
36#include "channel.h"
38#include "connection.h" // MySQLRoutingConnectionBase
45#include "processor.h"
46#include "sql_exec_context.h"
47#include "tracer.h"
48
49/**
50 * protocol state of a classic protocol connection.
51 */
53 public:
54 enum class HandshakeState {
59 };
60
62
66 std::optional<classic_protocol::message::server::Greeting>
68 std::string username, //
69 std::string schema, //
70 std::string attributes)
71 : server_caps_{server_caps},
72 client_caps_{client_caps},
74 username_{std::move(username)},
75 schema_{std::move(schema)},
77
79 server_caps_ = caps;
80 }
81
83 client_caps_ = caps;
84 }
85
87 return client_caps_;
88 }
89
91 return server_caps_;
92 }
93
96 }
97
98 std::optional<classic_protocol::message::client::Greeting> client_greeting()
99 const {
100 return client_greeting_;
101 }
102
104 std::optional<classic_protocol::message::client::Greeting> msg) {
105 client_greeting_ = std::move(msg);
106 }
107
108 std::optional<classic_protocol::message::server::Greeting> server_greeting()
109 const {
110 return server_greeting_;
111 }
112
114 std::optional<classic_protocol::message::server::Greeting> msg) {
115 server_greeting_ = std::move(msg);
116 }
117
118 uint8_t &seq_id() { return seq_id_; }
119 uint8_t seq_id() const { return seq_id_; }
120
121 void seq_id(uint8_t id) { seq_id_ = id; }
122
123 struct FrameInfo {
124 uint8_t seq_id_; //!< sequence id.
125 size_t frame_size_; //!< size of the whole frame.
126 size_t forwarded_frame_size_; //!< size of the whole frame that's already
127 //!< forwarded.
128 };
129
130 std::optional<FrameInfo> &current_frame() { return current_frame_; }
131 std::optional<uint8_t> &current_msg_type() { return msg_type_; }
132
133 uint64_t columns_left{};
134 uint32_t params_left{};
135
136 [[nodiscard]] std::string auth_method_name() const {
137 return auth_method_name_;
138 }
139
140 void auth_method_name(std::string name) {
141 auth_method_name_ = std::move(name);
142 }
143
144 [[nodiscard]] std::string auth_method_data() const {
145 return auth_method_data_;
146 }
147
148 void auth_method_data(std::string data) {
149 auth_method_data_ = std::move(data);
150 }
151
152 std::string username() { return username_; }
153 void username(std::string user) { username_ = std::move(user); }
154
155 void password(std::optional<std::string> pw) { password_ = std::move(pw); }
156 std::optional<std::string> password() const { return password_; }
157
158 std::string schema() { return schema_; }
159 void schema(std::string s) { schema_ = std::move(s); }
160
161 // connection attributes there were received.
162 std::string attributes() { return recv_attributes_; }
163 void attributes(std::string attrs) { recv_attributes_ = std::move(attrs); }
164
165 // connection attributes that were sent.
166 std::string sent_attributes() { return sent_attributes_; }
167 void sent_attributes(std::string attrs) {
168 sent_attributes_ = std::move(attrs);
169 }
170
172
174
175 using PreparedStatements = std::unordered_map<uint32_t, PreparedStatement>;
176
178 return prepared_stmts_;
179 }
181
183 return status_flags_;
184 }
185
187 status_flags_ = val;
188 }
189
190 private:
193
194 std::optional<classic_protocol::message::client::Greeting> client_greeting_{};
195 std::optional<classic_protocol::message::server::Greeting> server_greeting_{};
196
197 std::optional<FrameInfo> current_frame_{};
198 std::optional<uint8_t> msg_type_{};
199
200 uint8_t seq_id_{255}; // next use will increment to 0
201
202 std::string username_;
203 std::optional<std::string> password_;
204 std::string schema_;
205 std::string recv_attributes_;
206 std::string sent_attributes_;
207
208 std::string auth_method_name_;
209 std::string auth_method_data_;
210
212
213 // status flags of the last statement.
215
217};
218
221 public std::enable_shared_from_this<MysqlRoutingClassicConnectionBase> {
222 protected:
223 // constructor
224 //
225 // use ::create() instead.
227 MySQLRoutingContext &context, RouteDestination *route_destination,
228 std::unique_ptr<ConnectionBase> client_connection,
229 std::unique_ptr<RoutingConnectionBase> client_routing_connection,
230 std::function<void(MySQLRoutingConnectionBase *)> remove_callback)
231 : MySQLRoutingConnectionBase{context, std::move(remove_callback)},
232 route_destination_{route_destination},
235 : Destinations{}},
237 TlsSwitchableConnection{std::move(client_connection),
238 std::move(client_routing_connection),
243 read_timer_{socket_splicer()->client_conn().connection()->io_ctx()},
244 connect_timer_{socket_splicer()->client_conn().connection()->io_ctx()} {
245 client_address(socket_splicer_->client_conn().endpoint());
246 }
247
248 public:
249 // create a new shared_ptr<ThisClass>
250 //
251 template <typename... Args>
252 [[nodiscard]] static std::shared_ptr<MysqlRoutingClassicConnectionBase>
254 // clang-format off
255 Args &&... args) {
256 // clang-format on
257
258 // can't use make_unique<> here as the constructor is private.
259 return std::shared_ptr<MysqlRoutingClassicConnectionBase>(
260 new MysqlRoutingClassicConnectionBase(std::forward<Args>(args)...));
261 }
262
263 // get a shared-ptr that refers the same 'this'
264 std::shared_ptr<MysqlRoutingClassicConnectionBase> getptr() {
265 return shared_from_this();
266 }
267
269 std::vector<uint8_t> &error_frame, const uint8_t seq_id,
271 const uint16_t error_code, const std::string &msg,
272 const std::string &sql_state);
273
276
278 return this->socket_splicer()->source_ssl_mode();
279 }
280
282 return this->socket_splicer()->dest_ssl_mode();
283 }
284
285 void disconnect() override;
286
287 virtual void async_run() {}
288
289 void send_server_failed(std::error_code ec, bool call_finish = true);
290
291 void recv_server_failed(std::error_code ec, bool call_finish = true);
292
293 void send_client_failed(std::error_code ec, bool call_finish = true);
294
295 void recv_client_failed(std::error_code ec, bool call_finish = true);
296
297 void server_socket_failed(std::error_code ec, bool call_finish = true);
298
299 virtual void client_socket_failed(std::error_code ec,
300 bool call_finish = true);
301
302 // resume
303 //
304 // A Processor may suspend by returning Result::Suspend. When woken,
305 // typically using an async timer, the Processor calls resume() to execute
306 // the next loop() iteration. This allows waiting asynchronously for a
307 // condition other than async io.
309
310 protected:
311 enum class Function {
312 kLoop,
313
314 kFinish,
315 };
316
318 switch (next) {
320 return finish();
321
322 case Function::kLoop:
323 return loop();
324 }
325 }
326
327 private:
328 // a stack of processors
329 //
330 // take the last processor until its done.
331 //
332 // Flow -> Greeting | Command
333 // Greeting -> Connect -> Server::Greeting
334 // Server::Greeting -> Server::Greeting::Greeting |
335 // Server::Greeting::Error Server::Greeting::Error -> Error::Fatal
336 // Server::Greeting::Greeting -> Client::Greeting
337 // Client::Greeting -> TlsConnect | Server::Greeting::Response
338 // TlsConnect -> Client::Greeting::Full | Error::Fatal
339 // Client::Greeting::Full -> Server::Ok | Auth::Switch | Server::Error
340 // Auth::Switch -> ...
341 // Auth
342 // Server::Ok -> Command
343 // Command ->
344 //
345 std::vector<std::unique_ptr<BasicProcessor>> processors_;
346
347 public:
348 void push_processor(std::unique_ptr<BasicProcessor> processor) {
349 return processors_.push_back(std::move(processor));
350 }
351
352 void pop_processor() { processors_.pop_back(); }
353
355 net::const_buffer session_trackers,
357 bool ignore_some_state_changed = false);
358
359 private:
361 std::string_view stage, Function func);
362
363 void async_send_client(Function next);
364
365 void async_recv_client(Function next);
366
367 void async_send_server(Function next);
368
369 void async_recv_server(Function next);
370
371 void async_recv_both(Function next);
372
374
376
378
379 private:
380 // the client didn't send a Greeting before closing the connection.
381 //
382 // Generate a Greeting to be sent to the server, to ensure the router's IP
383 // isn't blocked due to the server's max_connect_errors.
385
386 // main processing loop
387 void loop();
388
389 // after a QUIT, we should wait until the client closed the connection.
390
391 // called when the connection should be closed.
392 //
393 // called multiple times (once per "active_work_").
394 void finish();
395
396 // final state.
397 //
398 // removes the connection from the connection-container.
399 virtual void done();
400
401 public:
403 return dynamic_cast<ClassicProtocolState *>(
405 }
406
408 return dynamic_cast<const ClassicProtocolState *>(
410 }
411
413 return dynamic_cast<ClassicProtocolState *>(
415 }
416
418 return dynamic_cast<const ClassicProtocolState *>(
420 }
421
423 return socket_splicer_.get();
424 }
425
427
428 std::string get_destination_id() const override { return destination_id_; }
429
430 void destination_id(const std::string &id) { destination_id_ = id; }
431
432 /**
433 * check if the connection is authenticated.
434 *
435 * 'true' after the initial handshake and change-user finished with "ok".
436 * 'false' at connection start and after change-user is started.
437 *
438 * @retval true if the connection is authenticated.
439 * @return false otherwise
440 */
441 bool authenticated() const { return authenticated_; }
442 void authenticated(bool v) { authenticated_ = v; }
443
444 /**
445 * check if connection sharing is possible.
446 *
447 * - the configuration enabled it
448 */
449 bool connection_sharing_possible() const;
450
451 /**
452 * check if connection sharing is allowed.
453 *
454 * - connection sharing is possible.
455 * - no active transaction
456 * - no SET TRANSACTION
457 */
458 bool connection_sharing_allowed() const;
459
460 /**
461 * reset the connection-sharing state.
462 *
463 * - after COM_RESET_CONNECTION::ok
464 * - after COM_CHANGE_USER::ok
465 */
467
468 private:
470
471 bool authenticated_{false};
472
473 public:
474 /**
475 * if the router is sending the initial server-greeting.
476 *
477 * if true, the router sends the initial greeting to the client,
478 * if false, the server is sending the initial greeting and router is forward
479 * it.
480 */
481 bool greeting_from_router() const {
482 return !((source_ssl_mode() == SslMode::kPassthrough) ||
485 }
486
487 void requires_tls(bool v) { requires_tls_ = v; }
488
489 bool requires_tls() const { return requires_tls_; }
490
492
495
498 }
499
502 }
503
504 private:
507
508 std::unique_ptr<ProtocolSplicerBase> socket_splicer_;
509
510 std::string destination_id_;
511
512 /**
513 * client side handshake isn't finished yet.
514 */
515 bool in_handshake_{true};
516
517 std::optional<classic_protocol::session_track::TransactionState> trx_state_;
518 std::optional<classic_protocol::session_track::TransactionCharacteristics>
521
523
524 bool requires_tls_{true};
525
526 public:
529
530 private:
532
533 public:
535
536 Tracer &tracer() { return tracer_; }
537
538 private:
540
541 public:
544
545 void connect_error_code(const std::error_code &ec) { connect_ec_ = ec; }
546 std::error_code connect_error_code() const { return connect_ec_; }
547
550 }
552
553 enum class FromEither {
554 None,
555 Started,
558 };
559
561
563
564 private:
567
568 std::error_code connect_ec_{};
569
571
573};
574
575#endif
protocol state of a classic protocol connection.
Definition: classic_connection_base.h:52
HandshakeState handshake_state_
Definition: classic_connection_base.h:216
classic_protocol::capabilities::value_type server_caps_
Definition: classic_connection_base.h:191
uint8_t seq_id() const
Definition: classic_connection_base.h:119
std::string schema()
Definition: classic_connection_base.h:158
ClassicProtocolState()=default
PreparedStatements & prepared_statements()
Definition: classic_connection_base.h:180
void sent_attributes(std::string attrs)
Definition: classic_connection_base.h:167
void seq_id(uint8_t id)
Definition: classic_connection_base.h:121
std::string auth_method_name() const
Definition: classic_connection_base.h:136
void handshake_state(HandshakeState state)
Definition: classic_connection_base.h:173
void status_flags(classic_protocol::status::value_type val)
Definition: classic_connection_base.h:186
uint8_t & seq_id()
Definition: classic_connection_base.h:118
std::unordered_map< uint32_t, PreparedStatement > PreparedStatements
Definition: classic_connection_base.h:175
std::optional< classic_protocol::message::server::Greeting > server_greeting() const
Definition: classic_connection_base.h:108
HandshakeState handshake_state() const
Definition: classic_connection_base.h:171
void server_capabilities(classic_protocol::capabilities::value_type caps)
Definition: classic_connection_base.h:78
std::string auth_method_data() const
Definition: classic_connection_base.h:144
HandshakeState
Definition: classic_connection_base.h:54
void password(std::optional< std::string > pw)
Definition: classic_connection_base.h:155
std::string sent_attributes()
Definition: classic_connection_base.h:166
std::string auth_method_name_
Definition: classic_connection_base.h:208
void client_greeting(std::optional< classic_protocol::message::client::Greeting > msg)
Definition: classic_connection_base.h:103
void server_greeting(std::optional< classic_protocol::message::server::Greeting > msg)
Definition: classic_connection_base.h:113
std::string sent_attributes_
Definition: classic_connection_base.h:206
std::optional< FrameInfo > & current_frame()
Definition: classic_connection_base.h:130
std::optional< uint8_t > msg_type_
Definition: classic_connection_base.h:198
std::optional< uint8_t > & current_msg_type()
Definition: classic_connection_base.h:131
classic_protocol::capabilities::value_type client_caps_
Definition: classic_connection_base.h:192
uint8_t seq_id_
Definition: classic_connection_base.h:200
void client_capabilities(classic_protocol::capabilities::value_type caps)
Definition: classic_connection_base.h:82
uint64_t columns_left
Definition: classic_connection_base.h:133
void schema(std::string s)
Definition: classic_connection_base.h:159
std::optional< classic_protocol::message::server::Greeting > server_greeting_
Definition: classic_connection_base.h:195
std::string username_
Definition: classic_connection_base.h:202
void auth_method_name(std::string name)
Definition: classic_connection_base.h:140
void attributes(std::string attrs)
Definition: classic_connection_base.h:163
classic_protocol::status::value_type status_flags() const
Definition: classic_connection_base.h:182
std::optional< FrameInfo > current_frame_
Definition: classic_connection_base.h:197
ClassicProtocolState(classic_protocol::capabilities::value_type server_caps, classic_protocol::capabilities::value_type client_caps, std::optional< classic_protocol::message::server::Greeting > server_greeting, std::string username, std::string schema, std::string attributes)
Definition: classic_connection_base.h:63
classic_protocol::capabilities::value_type client_capabilities() const
Definition: classic_connection_base.h:86
uint32_t params_left
Definition: classic_connection_base.h:134
classic_protocol::status::value_type status_flags_
Definition: classic_connection_base.h:214
void auth_method_data(std::string data)
Definition: classic_connection_base.h:148
std::optional< classic_protocol::message::client::Greeting > client_greeting() const
Definition: classic_connection_base.h:98
std::string auth_method_data_
Definition: classic_connection_base.h:209
PreparedStatements prepared_stmts_
Definition: classic_connection_base.h:211
std::optional< classic_protocol::message::client::Greeting > client_greeting_
Definition: classic_connection_base.h:194
std::string recv_attributes_
Definition: classic_connection_base.h:205
std::optional< std::string > password() const
Definition: classic_connection_base.h:156
classic_protocol::capabilities::value_type server_capabilities() const
Definition: classic_connection_base.h:90
void username(std::string user)
Definition: classic_connection_base.h:153
std::string username()
Definition: classic_connection_base.h:152
std::optional< std::string > password_
Definition: classic_connection_base.h:203
const PreparedStatements & prepared_statements() const
Definition: classic_connection_base.h:177
std::string attributes()
Definition: classic_connection_base.h:162
classic_protocol::capabilities::value_type shared_capabilities() const
Definition: classic_connection_base.h:94
std::string schema_
Definition: classic_connection_base.h:204
A forward iterable container of destinations.
Definition: destination.h:97
execution context for SQL.
Definition: sql_exec_context.h:43
Definition: connection.h:43
MySQLRoutingContext & context()
Definition: connection.h:52
void client_address(const std::string &dest)
Definition: connection.h:63
MySQLRoutingContext holds data used by MySQLRouting (1 per plugin instances) and MySQLRoutingConnecti...
Definition: context.h:59
Definition: classic_connection_base.h:221
std::optional< classic_protocol::session_track::TransactionCharacteristics > trx_characteristics_
Definition: classic_connection_base.h:519
bool authenticated_
Definition: classic_connection_base.h:471
RouteDestination * destinations()
Definition: classic_connection_base.h:493
void destination_id(const std::string &id)
Definition: classic_connection_base.h:430
bool connection_sharing_possible() const
check if connection sharing is possible.
Definition: classic_connection_base.cc:834
bool authenticated() const
check if the connection is authenticated.
Definition: classic_connection_base.h:441
bool collation_connection_maybe_dirty_
Definition: classic_connection_base.h:522
void on_handshake_received()
Definition: classic_connection_base.cc:94
std::string destination_id_
Definition: classic_connection_base.h:510
void recv_server_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:133
Destinations destinations_
Definition: classic_connection_base.h:506
void pop_processor()
Definition: classic_connection_base.h:352
void async_recv_server(Function next)
Definition: classic_connection_base.cc:305
virtual void async_run()
Definition: classic_connection_base.h:287
ExecutionContext exec_ctx_
Definition: classic_connection_base.h:531
ClassicProtocolState * server_protocol()
Definition: classic_connection_base.h:412
net::steady_timer connect_timer_
Definition: classic_connection_base.h:566
static stdx::expected< size_t, std::error_code > encode_error_packet(std::vector< uint8_t > &error_frame, const uint8_t seq_id, const classic_protocol::capabilities::value_type caps, const uint16_t error_code, const std::string &msg, const std::string &sql_state)
Definition: classic_connection_base.cc:56
void server_socket_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:160
void call_next_function(Function next)
Definition: classic_connection_base.h:317
bool diagnostic_area_changed_
Definition: classic_connection_base.h:570
void collation_connection_maybe_dirty(bool val)
Definition: classic_connection_base.h:496
std::unique_ptr< ProtocolSplicerBase > socket_splicer_
Definition: classic_connection_base.h:508
void authenticated(bool v)
Definition: classic_connection_base.h:442
const ProtocolSplicerBase * socket_splicer() const
Definition: classic_connection_base.h:422
const ClassicProtocolState * client_protocol() const
Definition: classic_connection_base.h:407
net::steady_timer & connect_timer()
Definition: classic_connection_base.h:543
void send_client_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:142
bool connection_sharing_allowed() const
check if connection sharing is allowed.
Definition: classic_connection_base.cc:846
bool requires_tls() const
Definition: classic_connection_base.h:489
SslMode source_ssl_mode() const
Definition: classic_connection_base.h:277
void async_send_server(Function next)
Definition: classic_connection_base.cc:278
stdx::expected< void, std::error_code > track_session_changes(net::const_buffer session_trackers, classic_protocol::capabilities::value_type caps, bool ignore_some_state_changed=false)
Definition: classic_connection_base.cc:502
void trace_and_call_function(Tracer::Event::Direction dir, std::string_view stage, Function func)
Definition: classic_connection_base.cc:784
virtual void client_socket_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:184
void connect_error_code(const std::error_code &ec)
Definition: classic_connection_base.h:545
std::optional< classic_protocol::session_track::TransactionState > trx_state_
Definition: classic_connection_base.h:517
void async_send_client(Function next)
Definition: classic_connection_base.cc:230
void on_handshake_aborted()
Definition: classic_connection_base.cc:107
std::shared_ptr< MysqlRoutingClassicConnectionBase > getptr()
Definition: classic_connection_base.h:264
void disconnect() override
Definition: classic_connection_base.cc:416
Destinations & current_destinations()
Definition: classic_connection_base.h:494
bool some_state_changed_
Definition: classic_connection_base.h:520
bool requires_tls_
Definition: classic_connection_base.h:524
int active_work_
Definition: classic_connection_base.h:469
static std::shared_ptr< MysqlRoutingClassicConnectionBase > create(Args &&... args)
Definition: classic_connection_base.h:253
void requires_tls(bool v)
Definition: classic_connection_base.h:487
SslMode dest_ssl_mode() const
Definition: classic_connection_base.h:281
void async_recv_client(Function next)
Definition: classic_connection_base.cc:257
void connection_sharing_allowed_reset()
reset the connection-sharing state.
Definition: classic_connection_base.cc:857
void send_server_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:124
void some_state_changed(bool v)
Definition: classic_connection_base.h:491
void server_side_client_greeting()
Definition: classic_connection_base.cc:438
void async_wait_send_server(Function next)
Definition: classic_connection_base.cc:397
ProtocolSplicerBase * socket_splicer()
Definition: classic_connection_base.h:426
FromEither
Definition: classic_connection_base.h:553
std::vector< std::unique_ptr< BasicProcessor > > processors_
Definition: classic_connection_base.h:345
RouteDestination * route_destination_
Definition: classic_connection_base.h:505
FromEither recv_from_either_
Definition: classic_connection_base.h:572
ClassicProtocolState * client_protocol()
Definition: classic_connection_base.h:402
void push_processor(std::unique_ptr< BasicProcessor > processor)
Definition: classic_connection_base.h:348
FromEither recv_from_either() const
Definition: classic_connection_base.h:562
bool in_handshake_
client side handshake isn't finished yet.
Definition: classic_connection_base.h:515
std::error_code connect_ec_
Definition: classic_connection_base.h:568
ExecutionContext & execution_context()
Definition: classic_connection_base.h:527
net::steady_timer & read_timer()
Definition: classic_connection_base.h:542
void async_recv_both(Function next)
Definition: classic_connection_base.cc:323
void loop()
Definition: classic_connection_base.cc:794
void recv_from_either(FromEither v)
Definition: classic_connection_base.h:560
std::string get_destination_id() const override
Definition: classic_connection_base.h:428
virtual void done()
Definition: classic_connection_base.cc:499
void resume()
Definition: classic_connection_base.h:308
net::steady_timer read_timer_
Definition: classic_connection_base.h:565
Tracer tracer_
Definition: classic_connection_base.h:539
void recv_client_failed(std::error_code ec, bool call_finish=true)
Definition: classic_connection_base.cc:151
void finish()
Definition: classic_connection_base.cc:452
void diagnostic_area_changed(bool diagnostic_area_changed)
Definition: classic_connection_base.h:548
Function
Definition: classic_connection_base.h:311
const ExecutionContext & execution_context() const
Definition: classic_connection_base.h:528
bool greeting_from_router() const
if the router is sending the initial server-greeting.
Definition: classic_connection_base.h:481
const ClassicProtocolState * server_protocol() const
Definition: classic_connection_base.h:417
Tracer & tracer()
Definition: classic_connection_base.h:536
void trace(Tracer::Event e)
Definition: classic_connection_base.h:534
MysqlRoutingClassicConnectionBase(MySQLRoutingContext &context, RouteDestination *route_destination, std::unique_ptr< ConnectionBase > client_connection, std::unique_ptr< RoutingConnectionBase > client_routing_connection, std::function< void(MySQLRoutingConnectionBase *)> remove_callback)
Definition: classic_connection_base.h:226
bool diagnostic_area_changed() const
Definition: classic_connection_base.h:551
std::error_code connect_error_code() const
Definition: classic_connection_base.h:546
bool collation_connection_maybe_dirty() const
Definition: classic_connection_base.h:500
splices two connections together.
Definition: basic_protocol_splicer.h:484
TlsSwitchableConnection & client_conn()
Definition: basic_protocol_splicer.h:521
SslMode dest_ssl_mode() const
Definition: basic_protocol_splicer.h:537
SslMode source_ssl_mode() const
Definition: basic_protocol_splicer.h:533
TlsSwitchableConnection & server_conn()
Definition: basic_protocol_splicer.h:527
Definition: basic_protocol_splicer.h:291
Manage destinations for a Connection Routing.
Definition: destination.h:188
a Connection that can be switched to TLS.
Definition: basic_protocol_splicer.h:306
ProtocolStateBase * protocol()
Definition: basic_protocol_splicer.h:449
Definition: tracer.h:61
Direction
Definition: tracer.h:73
traces the timestamps of events in a stderr log.
Definition: tracer.h:49
void trace(Event e)
Definition: tracer.h:128
Definition: timer.h:57
Definition: buffer.h:135
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
char * user
Definition: mysqladmin.cc:60
std::bitset< 32 > value_type
Definition: classic_protocol_constants.h:73
std::bitset< 16 > value_type
Definition: classic_protocol_constants.h:168
std::string dir
Double write files location.
Definition: buf0dblwr.cc:77
Unique_ptr< T, std::nullptr_t > make_unique(size_t size)
In-place constructs a new unique pointer with no specific allocator and with array type T.
Definition: gcs_xcom_synode.h:64
SslMode
Definition: ssl_mode.h:29
@ kPassthrough
case opt name
Definition: sslopt-case.h:33
Definition: classic_connection_base.h:123
size_t forwarded_frame_size_
size of the whole frame that's already forwarded.
Definition: classic_connection_base.h:126
size_t frame_size_
size of the whole frame.
Definition: classic_connection_base.h:125
uint8_t seq_id_
sequence id.
Definition: classic_connection_base.h:124
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510