MySQL  8.0.16
Source Code Documentation
violite.h
Go to the documentation of this file.
1 /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /**
24  @file include/violite.h
25  Vio Lite.
26  Purpose: include file for Vio that will work with C and C++.
27 */
28 
29 #ifndef vio_violite_h_
30 #define vio_violite_h_
31 
32 #include "my_config.h"
33 
34 #include <stddef.h>
35 #ifdef HAVE_SYS_SOCKET_H
36 #include <sys/socket.h>
37 #endif
38 #include <sys/types.h>
39 
40 #include <string>
41 
42 #include "my_inttypes.h"
43 #include "my_psi_config.h" // IWYU pragma: keep
47 
48 struct Vio;
49 
50 /* Simple vio interface in C; The functions are implemented in violite.c */
51 
52 #if !defined(_WIN32) && !defined(HAVE_KQUEUE) && !defined(__SUNPRO_CC)
53 #define USE_PPOLL_IN_VIO
54 #endif
55 
56 #if defined(__cplusplus) && defined(USE_PPOLL_IN_VIO)
57 #include <signal.h>
58 #include <atomic>
59 #elif defined(__cplusplus) && defined(HAVE_KQUEUE)
60 #include <sys/event.h>
61 #include <atomic>
62 #endif
63 
64 #ifdef HAVE_PSI_INTERFACE
65 void init_vio_psi_keys();
66 #endif
67 
68 #ifndef MYSQL_VIO
69 struct Vio;
70 
71 typedef Vio Vio;
72 #define MYSQL_VIO Vio *
73 #endif
74 
75 enum enum_vio_type : int {
76  /**
77  Type of the connection is unknown.
78  */
80  /**
81  Used in case of TCP/IP connections.
82  */
84  /**
85  Used for Unix Domain socket connections. Unix only.
86  */
88  /**
89  Used for named pipe connections. Windows only.
90  */
92  /**
93  Used in case of SSL connections.
94  */
96  /**
97  Used for shared memory connections. Windows only.
98  */
100  /**
101  Used internally by the prepared statements
102  */
104  /**
105  Implicitly used by plugins that doesn't support any other VIO_TYPE.
106  */
108 
110  /*
111  If a new type is added, please update LAST_VIO_TYPE. In addition, please
112  change get_vio_type_name() in vio/vio.c to return correct name for it.
113  */
115 };
116 
117 /**
118  Convert a vio type to a printable string.
119  @param vio_type the type
120  @param[out] str the string
121  @param[out] len the string length
122 */
123 void get_vio_type_name(enum enum_vio_type vio_type, const char **str, int *len);
124 
125 /**
126  VIO I/O events.
127 */
132 };
133 
134 #define VIO_SOCKET_ERROR ((size_t)-1)
135 #define VIO_SOCKET_WANT_READ ((size_t)-2)
136 #define VIO_SOCKET_WANT_WRITE ((size_t)-3)
137 
138 #define VIO_LOCALHOST 1 /* a localhost connection */
139 #define VIO_BUFFERED_READ 2 /* use buffered read */
140 #define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */
141 #define OPENSSL_ERROR_LENGTH 512 /* Openssl error code max length */
142 
145  enum enum_vio_type type, uint flags);
146 
147 #ifdef _WIN32
148 MYSQL_VIO vio_new_win32pipe(HANDLE hPipe);
149 MYSQL_VIO vio_new_win32shared_memory(HANDLE handle_file_map, HANDLE handle_map,
150  HANDLE event_server_wrote,
151  HANDLE event_server_read,
152  HANDLE event_client_wrote,
153  HANDLE event_client_read,
154  HANDLE event_conn_closed);
155 #else
156 #define HANDLE void *
157 #endif /* _WIN32 */
158 
159 void vio_delete(MYSQL_VIO vio);
160 int vio_shutdown(MYSQL_VIO vio);
161 bool vio_reset(MYSQL_VIO vio, enum enum_vio_type type, my_socket sd, void *ssl,
162  uint flags);
163 bool vio_is_blocking(Vio *vio);
164 int vio_set_blocking(Vio *vio, bool set_blocking_mode);
166 size_t vio_read(MYSQL_VIO vio, uchar *buf, size_t size);
167 size_t vio_read_buff(MYSQL_VIO vio, uchar *buf, size_t size);
168 size_t vio_write(MYSQL_VIO vio, const uchar *buf, size_t size);
169 /* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */
170 int vio_fastsend(MYSQL_VIO vio);
171 /* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */
172 int vio_keepalive(MYSQL_VIO vio, bool onoff);
173 /* Whenever we should retry the last read/write operation. */
174 bool vio_should_retry(MYSQL_VIO vio);
175 /* Check that operation was timed out */
176 bool vio_was_timeout(MYSQL_VIO vio);
177 /* Short text description of the socket for those, who are curious.. */
178 #define VIO_DESCRIPTION_SIZE 30 /* size of description */
179 void vio_description(MYSQL_VIO vio, char *buf);
180 /* Return the type of the connection */
181 enum enum_vio_type vio_type(const MYSQL_VIO vio);
182 /* Return last error number */
183 int vio_errno(MYSQL_VIO vio);
184 /* Get socket number */
186 /* Remote peer's address and name in text form */
187 bool vio_peer_addr(MYSQL_VIO vio, char *buf, uint16 *port, size_t buflen);
188 /* Wait for an I/O event notification. */
189 int vio_io_wait(MYSQL_VIO vio, enum enum_vio_io_event event, int timeout);
190 bool vio_is_connected(MYSQL_VIO vio);
191 #ifndef DBUG_OFF
192 ssize_t vio_pending(MYSQL_VIO vio);
193 #endif
194 /* Set timeout for a network operation. */
195 int vio_timeout(MYSQL_VIO vio, uint which, int timeout_sec);
196 /* Connect to a peer. */
197 bool vio_socket_connect(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len,
198  bool nonblocking, int timeout);
199 
200 bool vio_get_normalized_ip_string(const struct sockaddr *addr,
201  size_t addr_length, char *ip_string,
202  size_t ip_string_size);
203 
204 bool vio_is_no_name_error(int err_code);
205 
206 int vio_getnameinfo(const struct sockaddr *sa, char *hostname,
207  size_t hostname_size, char *port, size_t port_size,
208  int flags);
209 
210 #if defined(HAVE_OPENSSL)
211 extern "C" {
212 #include <openssl/opensslv.h>
213 }
214 #if OPENSSL_VERSION_NUMBER < 0x0090700f
215 #define DES_cblock des_cblock
216 #define DES_key_schedule des_key_schedule
217 #define DES_set_key_unchecked(k, ks) des_set_key_unchecked((k), *(ks))
218 #define DES_ede3_cbc_encrypt(i, o, l, k1, k2, k3, iv, e) \
219  des_ede3_cbc_encrypt((i), (o), (l), *(k1), *(k2), *(k3), (iv), (e))
220 #endif
221 
222 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
223 #define HAVE_OPENSSL11 1
224 #endif // OPENSSL_VERSION_NUMBER
225 
226 /* apple deprecated openssl in MacOSX Lion */
227 #ifdef __APPLE__
228 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
229 #endif
230 
231 #define HEADER_DES_LOCL_H dummy_something
232 #ifndef WOLFSSL_MYSQL_COMPATIBLE
233 #define WOLFSSL_MYSQL_COMPATIBLE
234 #endif
235 /* Set wolfSSL to use same type as MySQL do for socket handles */
236 typedef my_socket WOLFSSL_SOCKET_T;
237 #define WOLFSSL_SOCKET_T_DEFINED
238 
239 // clang-format off
241 #include <openssl/err.h>
242 #include <openssl/ssl.h>
244 // clang-format on
245 
246 enum enum_ssl_init_error {
247  SSL_INITERR_NOERROR = 0,
248  SSL_INITERR_CERT,
249  SSL_INITERR_KEY,
250  SSL_INITERR_NOMATCH,
251  SSL_INITERR_BAD_PATHS,
252  SSL_INITERR_CIPHERS,
253  SSL_INITERR_MEMFAIL,
254  SSL_INITERR_NO_USABLE_CTX,
255  SSL_INITERR_DHFAIL,
256  SSL_TLS_VERSION_INVALID,
257  SSL_FIPS_MODE_INVALID,
258  SSL_FIPS_MODE_FAILED,
259  SSL_INITERR_LASTERR
260 };
261 const char *sslGetErrString(enum enum_ssl_init_error err);
262 
263 struct st_VioSSLFd {
264  SSL_CTX *ssl_context;
265 };
266 
267 int sslaccept(struct st_VioSSLFd *, MYSQL_VIO, long timeout,
268  unsigned long *errptr);
269 int sslconnect(struct st_VioSSLFd *, MYSQL_VIO, long timeout,
270  unsigned long *errptr, SSL **ssl);
271 
272 struct st_VioSSLFd *new_VioSSLConnectorFd(
273  const char *key_file, const char *cert_file, const char *ca_file,
274  const char *ca_path, const char *cipher, const char *ciphersuites,
275  enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path,
276  const long ssl_ctx_flags);
277 
278 long process_tls_version(const char *tls_version);
279 
280 int set_fips_mode(const uint fips_mode, char *err_string);
281 
282 uint get_fips_mode();
283 
284 struct st_VioSSLFd *new_VioSSLAcceptorFd(
285  const char *key_file, const char *cert_file, const char *ca_file,
286  const char *ca_path, const char *cipher, const char *ciphersuites,
287  enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path,
288  const long ssl_ctx_flags);
289 void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
290 
291 void vio_ssl_end();
292 
293 #endif /* HAVE_OPENSSL */
294 
295 void ssl_start(void);
296 void vio_end(void);
297 
298 #if !defined(DONT_MAP_VIO)
299 #define vio_delete(vio) (vio)->viodelete(vio)
300 #define vio_errno(vio) (vio)->vioerrno(vio)
301 #define vio_read(vio, buf, size) ((vio)->read)(vio, buf, size)
302 #define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size)
303 #define vio_fastsend(vio) (vio)->fastsend(vio)
304 #define vio_keepalive(vio, set_keep_alive) \
305  (vio)->viokeepalive(vio, set_keep_alive)
306 #define vio_should_retry(vio) (vio)->should_retry(vio)
307 #define vio_was_timeout(vio) (vio)->was_timeout(vio)
308 #define vio_shutdown(vio) ((vio)->vioshutdown)(vio)
309 #define vio_peer_addr(vio, buf, prt, buflen) \
310  (vio)->peer_addr(vio, buf, prt, buflen)
311 #define vio_io_wait(vio, event, timeout) (vio)->io_wait(vio, event, timeout)
312 #define vio_is_connected(vio) (vio)->is_connected(vio)
313 #define vio_is_blocking(vio) (vio)->is_blocking(vio)
314 #define vio_set_blocking(vio, val) (vio)->set_blocking(vio, val)
315 #define vio_set_blocking_flag(vio, val) (vio)->set_blocking_flag(vio, val)
316 #endif /* !defined(DONT_MAP_VIO) */
317 
318 /* This enumerator is used in parser - should be always visible */
319 enum SSL_type {
325 };
326 
327 /*
328  This structure is for every connection on both sides.
329  Note that it has a non-default move assignment operator, so if adding more
330  members, you'll need to update operator=.
331 */
332 struct Vio {
333  MYSQL_SOCKET mysql_socket; /* Instrumented socket */
334  bool localhost = {false}; /* Are we from localhost? */
335  enum_vio_type type = {NO_VIO_TYPE}; /* Type of connection */
336 
337  int read_timeout = {-1}; /* Timeout value (ms) for read ops. */
338  int write_timeout = {-1}; /* Timeout value (ms) for write ops. */
339  int retry_count = {1}; /* Retry count */
340  bool inactive = {false}; /* Connection has been shutdown */
341 
342  struct sockaddr_storage local; /* Local internet address */
343  struct sockaddr_storage remote; /* Remote internet address */
344  size_t addrLen = {0}; /* Length of remote address */
345  char *read_buffer = {nullptr}; /* buffer for vio_read_buff */
346  char *read_pos = {nullptr}; /* start of unfetched data in the
347  read buffer */
348  char *read_end = {nullptr}; /* end of unfetched data */
349 
350 #ifdef USE_PPOLL_IN_VIO
351  my_thread_t thread_id = {0}; // Thread PID
352  sigset_t signal_mask; // Signal mask
353  /*
354  Flag to indicate whether we are in poll or shutdown.
355  A true value of flag indicates either the socket
356  has called shutdown or it is sleeping on a poll call.
357  False value of this flag means that the socket is
358  not sleeping on a poll call.
359  This flag provides synchronization between two threads
360  one entering vio_io_wait and another entering vio_shutdown
361  for the same socket. If the other thread is waiting on poll
362  sleep, it wakes up the thread by sending a signal via
363  pthread_kill. Also it ensures that no other thread enters in
364  to a poll call if it's socket has undergone shutdown.
365 
366  */
367  std::atomic_flag poll_shutdown_flag = ATOMIC_FLAG_INIT;
368 #elif defined HAVE_KQUEUE
369  int kq_fd = {-1};
370  std::atomic_flag kevent_wakeup_flag = ATOMIC_FLAG_INIT;
371 #endif
372 
373 #ifdef HAVE_SETNS
374  /**
375  Socket network namespace.
376  */
377  char network_namespace[256];
378 #endif
379  /*
380  VIO vtable interface to be implemented by VIO's like SSL, Socket,
381  Named Pipe, etc.
382  */
383 
384  /*
385  viodelete is responsible for cleaning up the VIO object by freeing
386  internal buffers, closing descriptors, handles.
387  */
388  void (*viodelete)(MYSQL_VIO) = {nullptr};
389  int (*vioerrno)(MYSQL_VIO) = {nullptr};
390  size_t (*read)(MYSQL_VIO, uchar *, size_t) = {nullptr};
391  size_t (*write)(MYSQL_VIO, const uchar *, size_t) = {nullptr};
392  int (*timeout)(MYSQL_VIO, uint, bool) = {nullptr};
393  int (*viokeepalive)(MYSQL_VIO, bool) = {nullptr};
394  int (*fastsend)(MYSQL_VIO) = {nullptr};
395  bool (*peer_addr)(MYSQL_VIO, char *, uint16 *, size_t) = {nullptr};
396  void (*in_addr)(MYSQL_VIO, struct sockaddr_storage *) = {nullptr};
397  bool (*should_retry)(MYSQL_VIO) = {nullptr};
398  bool (*was_timeout)(MYSQL_VIO) = {nullptr};
399  /*
400  vioshutdown is resposnible to shutdown/close the channel, so that no
401  further communications can take place, however any related buffers,
402  descriptors, handles can remain valid after a shutdown.
403  */
404  int (*vioshutdown)(MYSQL_VIO) = {nullptr};
405  bool (*is_connected)(MYSQL_VIO) = {nullptr};
406  bool (*has_data)(MYSQL_VIO) = {nullptr};
407  int (*io_wait)(MYSQL_VIO, enum enum_vio_io_event, int) = {nullptr};
408  bool (*connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int) = {nullptr};
409 #ifdef _WIN32
410 #ifdef __clang__
411  OVERLAPPED overlapped = {0, 0, {{0, 0}}, nullptr};
412 #else
413  // MSVC, at least up to 2015, gives an internal error on the above.
414  OVERLAPPED overlapped = {0};
415 #endif
416  HANDLE hPipe{nullptr};
417 #endif
418 #ifdef HAVE_OPENSSL
419  void *ssl_arg = {nullptr};
420 #endif
421 #if defined(_WIN32)
422  HANDLE handle_file_map = {nullptr};
423  char *handle_map = {nullptr};
424  HANDLE event_server_wrote = {nullptr};
425  HANDLE event_server_read = {nullptr};
426  HANDLE event_client_wrote = {nullptr};
427  HANDLE event_client_read = {nullptr};
428  HANDLE event_conn_closed = {nullptr};
429  size_t shared_memory_remain = {0};
430  char *shared_memory_pos = {nullptr};
431 
432 #endif /* _WIN32 */
433  bool (*is_blocking)(Vio *vio) = {nullptr};
434  int (*set_blocking)(Vio *vio, bool val) = {nullptr};
435  int (*set_blocking_flag)(Vio *vio, bool val) = {nullptr};
436  /* Indicates whether socket or SSL based communication is blocking or not. */
437  bool is_blocking_flag = {true};
438 
439  private:
441  friend void internal_vio_delete(Vio *vio);
442  friend bool vio_reset(Vio *vio, enum_vio_type type, my_socket sd, void *ssl,
443  uint flags);
444 
445  explicit Vio(uint flags);
446  ~Vio();
447 
448  public:
449  Vio(const Vio &) = delete;
450  Vio &operator=(const Vio &) = delete;
451  Vio &operator=(Vio &&vio);
452 };
453 
454 #ifdef HAVE_OPENSSL
455 #define SSL_handle SSL *
456 #else
457 #define SSL_handle void *
458 #endif
459 
460 #endif /* vio_violite_h_ */
Used for shared memory connections.
Definition: violite.h:99
bool(* peer_addr)(MYSQL_VIO, char *, uint16 *, size_t)
Definition: violite.h:395
unsigned char uchar
Definition: my_inttypes.h:49
#define vio_is_connected(vio)
Definition: violite.h:312
char * read_end
Definition: violite.h:348
Definition: violite.h:321
MYSQL_VIO mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags)
Definition: vio.cc:420
bool(* should_retry)(MYSQL_VIO)
Definition: violite.h:397
Used internally by the prepared statements.
Definition: violite.h:103
sigset_t signal_mask
Definition: violite.h:352
Type of the connection is unknown.
Definition: violite.h:79
#define MYSQL_VIO
Definition: violite.h:72
size_t(* write)(MYSQL_VIO, const uchar *, size_t)
Definition: violite.h:391
Vio(uint flags)
Definition: vio.cc:105
int(* io_wait)(MYSQL_VIO, enum enum_vio_io_event, int)
Definition: violite.h:407
Some integer typedefs for easier portability.
int(* fastsend)(MYSQL_VIO)
Definition: violite.h:394
#define bool
Definition: config_static.h:42
static constexpr Flags SSL(1<< 11)
#define vio_is_blocking(vio)
Definition: violite.h:313
int(* timeout)(MYSQL_VIO, uint, bool)
Definition: violite.h:392
char * read_pos
Definition: violite.h:346
int(* viokeepalive)(MYSQL_VIO, bool)
Definition: violite.h:393
int vio_timeout(MYSQL_VIO vio, uint which, int timeout_sec)
bool(* connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int)
Definition: violite.h:408
#define vio_set_blocking(vio, val)
Definition: violite.h:314
Types to make different thread packages compatible.
#define vio_write(vio, buf, size)
Definition: violite.h:302
Definition: violite.h:130
int(* set_blocking)(Vio *vio, bool val)
Definition: violite.h:434
size_t vio_read_buff(MYSQL_VIO vio, uchar *buf, size_t size)
struct sockaddr_storage remote
Definition: violite.h:343
Definition: violite.h:322
Vio Vio
Definition: violite.h:69
int(* vioshutdown)(MYSQL_VIO)
Definition: violite.h:404
my_thread_t thread_id
Definition: violite.h:351
#define vio_keepalive(vio, set_keep_alive)
Definition: violite.h:304
static in_port_t port
Definition: testapp.c:33
bool vio_socket_connect(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len, bool nonblocking, int timeout)
Definition: violite.h:320
bool(* has_data)(MYSQL_VIO)
Definition: violite.h:406
#define vio_fastsend(vio)
Definition: violite.h:303
#define vio_should_retry(vio)
Definition: violite.h:306
enum enum_vio_type vio_type(const MYSQL_VIO vio)
#define vio_was_timeout(vio)
Definition: violite.h:307
bool(* is_blocking)(Vio *vio)
Definition: violite.h:433
Definition: violite.h:114
bool(* was_timeout)(MYSQL_VIO)
Definition: violite.h:398
bool vio_reset(MYSQL_VIO vio, enum enum_vio_type type, my_socket sd, void *ssl, uint flags)
#define HANDLE
Definition: violite.h:156
friend void internal_vio_delete(Vio *vio)
Definition: vio.cc:541
void vio_description(MYSQL_VIO vio, char *buf)
bool is_blocking_flag
Definition: violite.h:437
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
unsigned int len
Definition: dbug_analyze.cc:216
unsigned int uint
Definition: uca-dump.cc:29
int read_timeout
Definition: violite.h:337
MYSQL_VIO vio_new(my_socket sd, enum enum_vio_type type, uint flags)
Definition: vio.cc:439
enum_vio_type
Definition: violite.h:75
Used in case of TCP/IP connections.
Definition: violite.h:83
bool vio_get_normalized_ip_string(const struct sockaddr *addr, size_t addr_length, char *ip_string, size_t ip_string_size)
Return the normalized IP address string for a sock-address.
Definition: viosocket.cc:608
size_t(* read)(MYSQL_VIO, uchar *, size_t)
Definition: violite.h:390
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:910
#define vio_set_blocking_flag(vio, val)
Definition: violite.h:315
Definition: violite.h:332
Definition: violite.h:131
pthread_t my_thread_t
Definition: my_thread_bits.h:47
#define vio_errno(vio)
Definition: violite.h:300
int my_socket
Definition: my_io_bits.h:59
Definition: violite.h:323
An instrumented socket.
Definition: mysql_socket_bits.h:34
void ssl_start(void)
#define vio_io_wait(vio, event, timeout)
Definition: violite.h:311
#define vio_peer_addr(vio, buf, prt, buflen)
Definition: violite.h:309
void get_vio_type_name(enum enum_vio_type vio_type, const char **str, int *len)
Convert a vio type to a printable string.
Definition: vio.cc:582
enum_vio_io_event
VIO I/O events.
Definition: violite.h:128
Definition: violite.h:324
void vio_end(void)
Definition: vio.cc:555
char * read_buffer
Definition: violite.h:345
int write_timeout
Definition: violite.h:338
~Vio()
Definition: vio.cc:119
int(* set_blocking_flag)(Vio *vio, bool val)
Definition: violite.h:435
int retry_count
Definition: violite.h:339
int type
Definition: http_common.h:411
bool localhost
Definition: violite.h:334
int vio_getnameinfo(const struct sockaddr *sa, char *hostname, size_t hostname_size, char *port, size_t port_size, int flags)
This is a wrapper for the system getnameinfo(), because different OS differ in the getnameinfo() impl...
Definition: viosocket.cc:1220
#define vio_read(vio, buf, size)
Definition: violite.h:301
friend bool vio_reset(Vio *vio, enum_vio_type type, my_socket sd, void *ssl, uint flags)
Reinitialize an existing Vio object.
Definition: vio.cc:351
MYSQL_SOCKET mysql_socket
Definition: violite.h:333
size_t addrLen
Definition: violite.h:344
enum_vio_type type
Definition: violite.h:335
friend Vio * internal_vio_create(uint flags)
Definition: vio.cc:412
SSL_type
Definition: violite.h:319
Used for named pipe connections.
Definition: violite.h:91
bool(* is_connected)(MYSQL_VIO)
Definition: violite.h:405
Implicitly used by plugins that doesn&#39;t support any other VIO_TYPE.
Definition: violite.h:107
Types to make file and socket I/O compatible.
#define vio_delete(vio)
Definition: violite.h:299
ssize_t vio_pending(MYSQL_VIO vio)
void init_vio_psi_keys()
Definition: vio.cc:66
void(* viodelete)(MYSQL_VIO)
Definition: violite.h:388
Used in case of SSL connections.
Definition: violite.h:95
int(* vioerrno)(MYSQL_VIO)
Definition: violite.h:389
static int flags[50]
Definition: hp_test1.cc:39
Definition: violite.h:109
unsigned short uint16
Definition: my_inttypes.h:53
std::atomic_flag poll_shutdown_flag
Definition: violite.h:367
#define vio_shutdown(vio)
Definition: violite.h:308
Vio & operator=(const Vio &)=delete
void(* in_addr)(MYSQL_VIO, struct sockaddr_storage *)
Definition: violite.h:396
Definition: violite.h:129
my_socket vio_fd(MYSQL_VIO vio)
struct sockaddr_storage local
Definition: violite.h:342
bool inactive
Definition: violite.h:340
static int kq_fd
Definition: kqueue_timers.cc:44
Used for Unix Domain socket connections.
Definition: violite.h:87
Log error(cerr, "ERROR")
bool vio_is_no_name_error(int err_code)
Checks if the error code, returned by vio_getnameinfo(), means it was the "No-name" error...
Definition: viosocket.cc:1199