MySQL 8.0.37
Source Code Documentation
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 }
246
247 public:
248 // create a new shared_ptr<ThisClass>
249 //
250 template <typename... Args>
251 [[nodiscard]] static std::shared_ptr<MysqlRoutingClassicConnectionBase>
253 // clang-format off
254 Args &&... args) {
255 // clang-format on
256
257 // can't use make_unique<> here as the constructor is private.
258 return std::shared_ptr<MysqlRoutingClassicConnectionBase>(
259 new MysqlRoutingClassicConnectionBase(std::forward<Args>(args)...));
260 }
261
262 // get a shared-ptr that refers the same 'this'
263 std::shared_ptr<MysqlRoutingClassicConnectionBase> getptr() {
264 return shared_from_this();
265 }
266
268 std::vector<uint8_t> &error_frame, const uint8_t seq_id,
270 const uint16_t error_code, const std::string &msg,
271 const std::string &sql_state);
272
275
277 return this->socket_splicer()->source_ssl_mode();
278 }
279
281 return this->socket_splicer()->dest_ssl_mode();
282 }
283
284 std::string get_client_address() const override {
285 return socket_splicer()->client_conn().endpoint();
286 }
287
288 std::string get_server_address() const override {
289 return socket_splicer()->server_conn().endpoint();
290 }
291
292 void disconnect() override;
293
294 virtual void async_run() {}
295
296 void send_server_failed(std::error_code ec, bool call_finish = true);
297
298 void recv_server_failed(std::error_code ec, bool call_finish = true);
299
300 void send_client_failed(std::error_code ec, bool call_finish = true);
301
302 void recv_client_failed(std::error_code ec, bool call_finish = true);
303
304 void server_socket_failed(std::error_code ec, bool call_finish = true);
305
306 virtual void client_socket_failed(std::error_code ec,
307 bool call_finish = true);
308
309 // resume
310 //
311 // A Processor may suspend by returning Result::Suspend. When woken,
312 // typically using an async timer, the Processor calls resume() to execute
313 // the next loop() iteration. This allows waiting asynchronously for a
314 // condition other than async io.
316
317 protected:
318 enum class Function {
319 kLoop,
320
321 kFinish,
322 };
323
325 switch (next) {
327 return finish();
328
329 case Function::kLoop:
330 return loop();
331 }
332 }
333
334 private:
335 // a stack of processors
336 //
337 // take the last processor until its done.
338 //
339 // Flow -> Greeting | Command
340 // Greeting -> Connect -> Server::Greeting
341 // Server::Greeting -> Server::Greeting::Greeting |
342 // Server::Greeting::Error Server::Greeting::Error -> Error::Fatal
343 // Server::Greeting::Greeting -> Client::Greeting
344 // Client::Greeting -> TlsConnect | Server::Greeting::Response
345 // TlsConnect -> Client::Greeting::Full | Error::Fatal
346 // Client::Greeting::Full -> Server::Ok | Auth::Switch | Server::Error
347 // Auth::Switch -> ...
348 // Auth
349 // Server::Ok -> Command
350 // Command ->
351 //
352 std::vector<std::unique_ptr<BasicProcessor>> processors_;
353
354 public:
355 void push_processor(std::unique_ptr<BasicProcessor> processor) {
356 return processors_.push_back(std::move(processor));
357 }
358
359 void pop_processor() { processors_.pop_back(); }
360
362 net::const_buffer session_trackers,
364 bool ignore_some_state_changed = false);
365
366 private:
368 std::string_view stage, Function func);
369
370 void async_send_client(Function next);
371
372 void async_recv_client(Function next);
373
374 void async_send_server(Function next);
375
376 void async_recv_server(Function next);
377
378 void async_recv_both(Function next);
379
381
383
385
386 private:
387 // the client didn't send a Greeting before closing the connection.
388 //
389 // Generate a Greeting to be sent to the server, to ensure the router's IP
390 // isn't blocked due to the server's max_connect_errors.
392
393 // main processing loop
394 void loop();
395
396 // after a QUIT, we should wait until the client closed the connection.
397
398 // called when the connection should be closed.
399 //
400 // called multiple times (once per "active_work_").
401 void finish();
402
403 // final state.
404 //
405 // removes the connection from the connection-container.
406 virtual void done();
407
408 public:
410 return dynamic_cast<ClassicProtocolState *>(
412 }
413
415 return dynamic_cast<const ClassicProtocolState *>(
417 }
418
420 return dynamic_cast<ClassicProtocolState *>(
422 }
423
425 return dynamic_cast<const ClassicProtocolState *>(
427 }
428
430 return socket_splicer_.get();
431 }
432
434
435 std::string get_destination_id() const override { return destination_id_; }
436
437 void destination_id(const std::string &id) { destination_id_ = id; }
438
439 /**
440 * check if the connection is authenticated.
441 *
442 * 'true' after the initial handshake and change-user finished with "ok".
443 * 'false' at connection start and after change-user is started.
444 *
445 * @retval true if the connection is authenticated.
446 * @return false otherwise
447 */
448 bool authenticated() const { return authenticated_; }
449 void authenticated(bool v) { authenticated_ = v; }
450
451 /**
452 * check if connection sharing is possible.
453 *
454 * - the configuration enabled it
455 */
456 bool connection_sharing_possible() const;
457
458 /**
459 * check if connection sharing is allowed.
460 *
461 * - connection sharing is possible.
462 * - no active transaction
463 * - no SET TRANSACTION
464 */
465 bool connection_sharing_allowed() const;
466
467 /**
468 * reset the connection-sharing state.
469 *
470 * - after COM_RESET_CONNECTION::ok
471 * - after COM_CHANGE_USER::ok
472 */
474
475 private:
477
478 bool authenticated_{false};
479
480 public:
481 /**
482 * if the router is sending the initial server-greeting.
483 *
484 * if true, the router sends the initial greeting to the client,
485 * if false, the server is sending the initial greeting and router is forward
486 * it.
487 */
488 bool greeting_from_router() const {
489 return !((source_ssl_mode() == SslMode::kPassthrough) ||
492 }
493
494 void requires_tls(bool v) { requires_tls_ = v; }
495
496 bool requires_tls() const { return requires_tls_; }
497
499
502
505 }
506
509 }
510
511 private:
514
515 std::unique_ptr<ProtocolSplicerBase> socket_splicer_;
516
517 std::string destination_id_;
518
519 /**
520 * client side handshake isn't finished yet.
521 */
522 bool in_handshake_{true};
523
524 std::optional<classic_protocol::session_track::TransactionState> trx_state_;
525 std::optional<classic_protocol::session_track::TransactionCharacteristics>
528
530
531 bool requires_tls_{true};
532
533 public:
536
537 private:
539
540 public:
542
543 Tracer &tracer() { return tracer_; }
544
545 private:
547
548 public:
551
552 void connect_error_code(const std::error_code &ec) { connect_ec_ = ec; }
553 std::error_code connect_error_code() const { return connect_ec_; }
554
557 }
559
560 enum class FromEither {
561 None,
562 Started,
565 };
566
568
570
571 private:
574
575 std::error_code connect_ec_{};
576
578
580};
581
582#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
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:526
bool authenticated_
Definition: classic_connection_base.h:478
RouteDestination * destinations()
Definition: classic_connection_base.h:500
void destination_id(const std::string &id)
Definition: classic_connection_base.h:437
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:448
bool collation_connection_maybe_dirty_
Definition: classic_connection_base.h:529
void on_handshake_received()
Definition: classic_connection_base.cc:94
std::string destination_id_
Definition: classic_connection_base.h:517
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:513
void pop_processor()
Definition: classic_connection_base.h:359
void async_recv_server(Function next)
Definition: classic_connection_base.cc:305
virtual void async_run()
Definition: classic_connection_base.h:294
ExecutionContext exec_ctx_
Definition: classic_connection_base.h:538
ClassicProtocolState * server_protocol()
Definition: classic_connection_base.h:419
net::steady_timer connect_timer_
Definition: classic_connection_base.h:573
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:324
bool diagnostic_area_changed_
Definition: classic_connection_base.h:577
void collation_connection_maybe_dirty(bool val)
Definition: classic_connection_base.h:503
std::unique_ptr< ProtocolSplicerBase > socket_splicer_
Definition: classic_connection_base.h:515
void authenticated(bool v)
Definition: classic_connection_base.h:449
const ProtocolSplicerBase * socket_splicer() const
Definition: classic_connection_base.h:429
const ClassicProtocolState * client_protocol() const
Definition: classic_connection_base.h:414
net::steady_timer & connect_timer()
Definition: classic_connection_base.h:550
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:496
SslMode source_ssl_mode() const
Definition: classic_connection_base.h:276
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:552
std::optional< classic_protocol::session_track::TransactionState > trx_state_
Definition: classic_connection_base.h:524
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:263
void disconnect() override
Definition: classic_connection_base.cc:416
Destinations & current_destinations()
Definition: classic_connection_base.h:501
bool some_state_changed_
Definition: classic_connection_base.h:527
bool requires_tls_
Definition: classic_connection_base.h:531
int active_work_
Definition: classic_connection_base.h:476
static std::shared_ptr< MysqlRoutingClassicConnectionBase > create(Args &&... args)
Definition: classic_connection_base.h:252
void requires_tls(bool v)
Definition: classic_connection_base.h:494
SslMode dest_ssl_mode() const
Definition: classic_connection_base.h:280
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:498
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:433
FromEither
Definition: classic_connection_base.h:560
std::vector< std::unique_ptr< BasicProcessor > > processors_
Definition: classic_connection_base.h:352
RouteDestination * route_destination_
Definition: classic_connection_base.h:512
FromEither recv_from_either_
Definition: classic_connection_base.h:579
ClassicProtocolState * client_protocol()
Definition: classic_connection_base.h:409
void push_processor(std::unique_ptr< BasicProcessor > processor)
Definition: classic_connection_base.h:355
FromEither recv_from_either() const
Definition: classic_connection_base.h:569
bool in_handshake_
client side handshake isn't finished yet.
Definition: classic_connection_base.h:522
std::error_code connect_ec_
Definition: classic_connection_base.h:575
ExecutionContext & execution_context()
Definition: classic_connection_base.h:534
net::steady_timer & read_timer()
Definition: classic_connection_base.h:549
std::string get_client_address() const override
Returns address of client which connected to router.
Definition: classic_connection_base.h:284
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:567
std::string get_destination_id() const override
Definition: classic_connection_base.h:435
virtual void done()
Definition: classic_connection_base.cc:499
void resume()
Definition: classic_connection_base.h:315
std::string get_server_address() const override
Returns address of server to which connection is established.
Definition: classic_connection_base.h:288
net::steady_timer read_timer_
Definition: classic_connection_base.h:572
Tracer tracer_
Definition: classic_connection_base.h:546
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:555
Function
Definition: classic_connection_base.h:318
const ExecutionContext & execution_context() const
Definition: classic_connection_base.h:535
bool greeting_from_router() const
if the router is sending the initial server-greeting.
Definition: classic_connection_base.h:488
const ClassicProtocolState * server_protocol() const
Definition: classic_connection_base.h:424
Tracer & tracer()
Definition: classic_connection_base.h:543
void trace(Tracer::Event e)
Definition: classic_connection_base.h:541
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:558
std::error_code connect_error_code() const
Definition: classic_connection_base.h:553
bool collation_connection_maybe_dirty() const
Definition: classic_connection_base.h:507
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
std::string endpoint() const
Definition: basic_protocol_splicer.h:427
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