MySQL  8.0.18
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 #ifndef DBUG_OFF
178 /* Short text description of the socket for those, who are curious.. */
179 #define VIO_DESCRIPTION_SIZE 30 /* size of description */
180 void vio_description(MYSQL_VIO vio, char *buf);
181 #endif // DBUG_OFF
182 /* Return the type of the connection */
183 enum enum_vio_type vio_type(const MYSQL_VIO vio);
184 /* Return last error number */
185 int vio_errno(MYSQL_VIO vio);
186 /* Get socket number */
188 /* Remote peer's address and name in text form */
189 bool vio_peer_addr(MYSQL_VIO vio, char *buf, uint16 *port, size_t buflen);
190 /* Wait for an I/O event notification. */
191 int vio_io_wait(MYSQL_VIO vio, enum enum_vio_io_event event, int timeout);
192 bool vio_is_connected(MYSQL_VIO vio);
193 #ifndef DBUG_OFF
194 ssize_t vio_pending(MYSQL_VIO vio);
195 #endif
196 /* Set timeout for a network operation. */
197 int vio_timeout(MYSQL_VIO vio, uint which, int timeout_sec);
198 /* Connect to a peer. */
199 bool vio_socket_connect(MYSQL_VIO vio, struct sockaddr *addr, socklen_t len,
200  bool nonblocking, int timeout);
201 
202 bool vio_get_normalized_ip_string(const struct sockaddr *addr,
203  size_t addr_length, char *ip_string,
204  size_t ip_string_size);
205 
206 bool vio_is_no_name_error(int err_code);
207 
208 int vio_getnameinfo(const struct sockaddr *sa, char *hostname,
209  size_t hostname_size, char *port, size_t port_size,
210  int flags);
211 
212 #if defined(HAVE_OPENSSL)
213 extern "C" {
214 #include <openssl/opensslv.h>
215 }
216 #if OPENSSL_VERSION_NUMBER < 0x0090700f
217 #define DES_cblock des_cblock
218 #define DES_key_schedule des_key_schedule
219 #define DES_set_key_unchecked(k, ks) des_set_key_unchecked((k), *(ks))
220 #define DES_ede3_cbc_encrypt(i, o, l, k1, k2, k3, iv, e) \
221  des_ede3_cbc_encrypt((i), (o), (l), *(k1), *(k2), *(k3), (iv), (e))
222 #endif
223 
224 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
225 #define HAVE_OPENSSL11 1
226 #endif // OPENSSL_VERSION_NUMBER
227 
228 /* apple deprecated openssl in MacOSX Lion */
229 #ifdef __APPLE__
230 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
231 #endif
232 
233 #define HEADER_DES_LOCL_H dummy_something
234 
235 #include <openssl/err.h>
236 #include <openssl/ssl.h>
237 
238 enum enum_ssl_init_error {
239  SSL_INITERR_NOERROR = 0,
240  SSL_INITERR_CERT,
241  SSL_INITERR_KEY,
242  SSL_INITERR_NOMATCH,
243  SSL_INITERR_BAD_PATHS,
244  SSL_INITERR_CIPHERS,
245  SSL_INITERR_MEMFAIL,
246  SSL_INITERR_NO_USABLE_CTX,
247  SSL_INITERR_DHFAIL,
248  SSL_TLS_VERSION_INVALID,
249  SSL_FIPS_MODE_INVALID,
250  SSL_FIPS_MODE_FAILED,
251  SSL_INITERR_LASTERR
252 };
253 const char *sslGetErrString(enum enum_ssl_init_error err);
254 
255 struct st_VioSSLFd {
256  SSL_CTX *ssl_context;
257 };
258 
259 int sslaccept(struct st_VioSSLFd *, MYSQL_VIO, long timeout,
260  unsigned long *errptr);
261 int sslconnect(struct st_VioSSLFd *, MYSQL_VIO, long timeout,
262  unsigned long *errptr, SSL **ssl);
263 
264 struct st_VioSSLFd *new_VioSSLConnectorFd(
265  const char *key_file, const char *cert_file, const char *ca_file,
266  const char *ca_path, const char *cipher, const char *ciphersuites,
267  enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path,
268  const long ssl_ctx_flags);
269 
270 long process_tls_version(const char *tls_version);
271 
272 int set_fips_mode(const uint fips_mode, char *err_string);
273 
274 uint get_fips_mode();
275 
276 struct st_VioSSLFd *new_VioSSLAcceptorFd(
277  const char *key_file, const char *cert_file, const char *ca_file,
278  const char *ca_path, const char *cipher, const char *ciphersuites,
279  enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path,
280  const long ssl_ctx_flags);
281 void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
282 
283 void vio_ssl_end();
284 
285 #endif /* HAVE_OPENSSL */
286 
287 void ssl_start(void);
288 void vio_end(void);
289 
290 #if !defined(DONT_MAP_VIO)
291 #define vio_delete(vio) (vio)->viodelete(vio)
292 #define vio_errno(vio) (vio)->vioerrno(vio)
293 #define vio_read(vio, buf, size) ((vio)->read)(vio, buf, size)
294 #define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size)
295 #define vio_fastsend(vio) (vio)->fastsend(vio)
296 #define vio_keepalive(vio, set_keep_alive) \
297  (vio)->viokeepalive(vio, set_keep_alive)
298 #define vio_should_retry(vio) (vio)->should_retry(vio)
299 #define vio_was_timeout(vio) (vio)->was_timeout(vio)
300 #define vio_shutdown(vio) ((vio)->vioshutdown)(vio)
301 #define vio_peer_addr(vio, buf, prt, buflen) \
302  (vio)->peer_addr(vio, buf, prt, buflen)
303 #define vio_io_wait(vio, event, timeout) (vio)->io_wait(vio, event, timeout)
304 #define vio_is_connected(vio) (vio)->is_connected(vio)
305 #define vio_is_blocking(vio) (vio)->is_blocking(vio)
306 #define vio_set_blocking(vio, val) (vio)->set_blocking(vio, val)
307 #define vio_set_blocking_flag(vio, val) (vio)->set_blocking_flag(vio, val)
308 #endif /* !defined(DONT_MAP_VIO) */
309 
310 /* This enumerator is used in parser - should be always visible */
311 enum SSL_type {
317 };
318 
319 /*
320  This structure is for every connection on both sides.
321  Note that it has a non-default move assignment operator, so if adding more
322  members, you'll need to update operator=.
323 */
324 struct Vio {
325  MYSQL_SOCKET mysql_socket; /* Instrumented socket */
326  bool localhost = {false}; /* Are we from localhost? */
327  enum_vio_type type = {NO_VIO_TYPE}; /* Type of connection */
328 
329  int read_timeout = {-1}; /* Timeout value (ms) for read ops. */
330  int write_timeout = {-1}; /* Timeout value (ms) for write ops. */
331  int retry_count = {1}; /* Retry count */
332  bool inactive = {false}; /* Connection has been shutdown */
333 
334  struct sockaddr_storage local; /* Local internet address */
335  struct sockaddr_storage remote; /* Remote internet address */
336  size_t addrLen = {0}; /* Length of remote address */
337  char *read_buffer = {nullptr}; /* buffer for vio_read_buff */
338  char *read_pos = {nullptr}; /* start of unfetched data in the
339  read buffer */
340  char *read_end = {nullptr}; /* end of unfetched data */
341 
342 #ifdef USE_PPOLL_IN_VIO
343  my_thread_t thread_id = {0}; // Thread PID
344  sigset_t signal_mask; // Signal mask
345  /*
346  Flag to indicate whether we are in poll or shutdown.
347  A true value of flag indicates either the socket
348  has called shutdown or it is sleeping on a poll call.
349  False value of this flag means that the socket is
350  not sleeping on a poll call.
351  This flag provides synchronization between two threads
352  one entering vio_io_wait and another entering vio_shutdown
353  for the same socket. If the other thread is waiting on poll
354  sleep, it wakes up the thread by sending a signal via
355  pthread_kill. Also it ensures that no other thread enters in
356  to a poll call if it's socket has undergone shutdown.
357 
358  */
359  std::atomic_flag poll_shutdown_flag = ATOMIC_FLAG_INIT;
360 #elif defined HAVE_KQUEUE
361  int kq_fd = {-1};
362  std::atomic_flag kevent_wakeup_flag = ATOMIC_FLAG_INIT;
363 #endif
364 
365 #ifdef HAVE_SETNS
366  /**
367  Socket network namespace.
368  */
369  char network_namespace[256];
370 #endif
371  /*
372  VIO vtable interface to be implemented by VIO's like SSL, Socket,
373  Named Pipe, etc.
374  */
375 
376  /*
377  viodelete is responsible for cleaning up the VIO object by freeing
378  internal buffers, closing descriptors, handles.
379  */
380  void (*viodelete)(MYSQL_VIO) = {nullptr};
381  int (*vioerrno)(MYSQL_VIO) = {nullptr};
382  size_t (*read)(MYSQL_VIO, uchar *, size_t) = {nullptr};
383  size_t (*write)(MYSQL_VIO, const uchar *, size_t) = {nullptr};
384  int (*timeout)(MYSQL_VIO, uint, bool) = {nullptr};
385  int (*viokeepalive)(MYSQL_VIO, bool) = {nullptr};
386  int (*fastsend)(MYSQL_VIO) = {nullptr};
387  bool (*peer_addr)(MYSQL_VIO, char *, uint16 *, size_t) = {nullptr};
388  void (*in_addr)(MYSQL_VIO, struct sockaddr_storage *) = {nullptr};
389  bool (*should_retry)(MYSQL_VIO) = {nullptr};
390  bool (*was_timeout)(MYSQL_VIO) = {nullptr};
391  /*
392  vioshutdown is resposnible to shutdown/close the channel, so that no
393  further communications can take place, however any related buffers,
394  descriptors, handles can remain valid after a shutdown.
395  */
396  int (*vioshutdown)(MYSQL_VIO) = {nullptr};
397  bool (*is_connected)(MYSQL_VIO) = {nullptr};
398  bool (*has_data)(MYSQL_VIO) = {nullptr};
399  int (*io_wait)(MYSQL_VIO, enum enum_vio_io_event, int) = {nullptr};
400  bool (*connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int) = {nullptr};
401 #ifdef _WIN32
402 #ifdef __clang__
403  OVERLAPPED overlapped = {0, 0, {{0, 0}}, nullptr};
404 #else
405  // MSVC, at least up to 2015, gives an internal error on the above.
406  OVERLAPPED overlapped = {0};
407 #endif
408  HANDLE hPipe{nullptr};
409 #endif
410 #ifdef HAVE_OPENSSL
411  void *ssl_arg = {nullptr};
412 #endif
413 #if defined(_WIN32)
414  HANDLE handle_file_map = {nullptr};
415  char *handle_map = {nullptr};
416  HANDLE event_server_wrote = {nullptr};
417  HANDLE event_server_read = {nullptr};
418  HANDLE event_client_wrote = {nullptr};
419  HANDLE event_client_read = {nullptr};
420  HANDLE event_conn_closed = {nullptr};
421  size_t shared_memory_remain = {0};
422  char *shared_memory_pos = {nullptr};
423 
424 #endif /* _WIN32 */
425  bool (*is_blocking)(Vio *vio) = {nullptr};
426  int (*set_blocking)(Vio *vio, bool val) = {nullptr};
427  int (*set_blocking_flag)(Vio *vio, bool val) = {nullptr};
428  /* Indicates whether socket or SSL based communication is blocking or not. */
429  bool is_blocking_flag = {true};
430 
431  private:
433  friend void internal_vio_delete(Vio *vio);
434  friend bool vio_reset(Vio *vio, enum_vio_type type, my_socket sd, void *ssl,
435  uint flags);
436 
437  explicit Vio(uint flags);
438  ~Vio();
439 
440  public:
441  Vio(const Vio &) = delete;
442  Vio &operator=(const Vio &) = delete;
443  Vio &operator=(Vio &&vio);
444 };
445 
446 #ifdef HAVE_OPENSSL
447 #define SSL_handle SSL *
448 #else
449 #define SSL_handle void *
450 #endif
451 
452 #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:387
unsigned char uchar
Definition: my_inttypes.h:51
#define vio_is_connected(vio)
Definition: violite.h:304
char * read_end
Definition: violite.h:340
Definition: violite.h:313
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:389
Used internally by the prepared statements.
Definition: violite.h:103
sigset_t signal_mask
Definition: violite.h:344
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:383
Vio(uint flags)
Definition: vio.cc:105
int(* io_wait)(MYSQL_VIO, enum enum_vio_io_event, int)
Definition: violite.h:399
Some integer typedefs for easier portability.
int(* fastsend)(MYSQL_VIO)
Definition: violite.h:386
#define bool
Definition: config_static.h:42
static constexpr Flags SSL(1<< 11)
#define vio_is_blocking(vio)
Definition: violite.h:305
int(* timeout)(MYSQL_VIO, uint, bool)
Definition: violite.h:384
char * read_pos
Definition: violite.h:338
int(* viokeepalive)(MYSQL_VIO, bool)
Definition: violite.h:385
int vio_timeout(MYSQL_VIO vio, uint which, int timeout_sec)
bool(* connect)(MYSQL_VIO, struct sockaddr *, socklen_t, int)
Definition: violite.h:400
#define vio_set_blocking(vio, val)
Definition: violite.h:306
Types to make different thread packages compatible.
#define vio_write(vio, buf, size)
Definition: violite.h:294
Definition: violite.h:130
int(* set_blocking)(Vio *vio, bool val)
Definition: violite.h:426
size_t vio_read_buff(MYSQL_VIO vio, uchar *buf, size_t size)
struct sockaddr_storage remote
Definition: violite.h:335
Definition: violite.h:314
Vio Vio
Definition: violite.h:69
int(* vioshutdown)(MYSQL_VIO)
Definition: violite.h:396
my_thread_t thread_id
Definition: violite.h:343
#define vio_keepalive(vio, set_keep_alive)
Definition: violite.h:296
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:312
bool(* has_data)(MYSQL_VIO)
Definition: violite.h:398
#define vio_fastsend(vio)
Definition: violite.h:295
#define vio_should_retry(vio)
Definition: violite.h:298
enum enum_vio_type vio_type(const MYSQL_VIO vio)
#define vio_was_timeout(vio)
Definition: violite.h:299
bool(* is_blocking)(Vio *vio)
Definition: violite.h:425
Definition: violite.h:114
bool(* was_timeout)(MYSQL_VIO)
Definition: violite.h:390
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
struct in_addr in_addr
Definition: sock_probe_win32.c:65
void vio_description(MYSQL_VIO vio, char *buf)
bool is_blocking_flag
Definition: violite.h:429
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
uint16_t uint16
Definition: my_inttypes.h:64
unsigned int uint
Definition: uca-dump.cc:29
int read_timeout
Definition: violite.h:329
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:611
size_t(* read)(MYSQL_VIO, uchar *, size_t)
Definition: violite.h:382
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:908
#define vio_set_blocking_flag(vio, val)
Definition: violite.h:307
Definition: violite.h:324
Definition: violite.h:131
pthread_t my_thread_t
Definition: my_thread_bits.h:47
#define vio_errno(vio)
Definition: violite.h:292
int my_socket
Definition: my_io_bits.h:59
Definition: violite.h:315
An instrumented socket.
Definition: mysql_socket_bits.h:34
void ssl_start(void)
#define vio_io_wait(vio, event, timeout)
Definition: violite.h:303
#define vio_peer_addr(vio, buf, prt, buflen)
Definition: violite.h:301
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:580
enum_vio_io_event
VIO I/O events.
Definition: violite.h:128
Definition: violite.h:316
void vio_end(void)
Definition: vio.cc:555
char * read_buffer
Definition: violite.h:337
int write_timeout
Definition: violite.h:330
~Vio()
Definition: vio.cc:119
int(* set_blocking_flag)(Vio *vio, bool val)
Definition: violite.h:427
int retry_count
Definition: violite.h:331
int type
Definition: http_common.h:411
bool localhost
Definition: violite.h:326
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:1218
#define vio_read(vio, buf, size)
Definition: violite.h:293
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:325
size_t addrLen
Definition: violite.h:336
enum_vio_type type
Definition: violite.h:327
friend Vio * internal_vio_create(uint flags)
Definition: vio.cc:412
SSL_type
Definition: violite.h:311
Used for named pipe connections.
Definition: violite.h:91
bool(* is_connected)(MYSQL_VIO)
Definition: violite.h:397
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:291
ssize_t vio_pending(MYSQL_VIO vio)
void init_vio_psi_keys()
Definition: vio.cc:66
void(* viodelete)(MYSQL_VIO)
Definition: violite.h:380
Used in case of SSL connections.
Definition: violite.h:95
int(* vioerrno)(MYSQL_VIO)
Definition: violite.h:381
static int flags[50]
Definition: hp_test1.cc:39
Definition: violite.h:109
std::atomic_flag poll_shutdown_flag
Definition: violite.h:359
struct sockaddr sockaddr
Definition: sock_probe_win32.c:63
#define vio_shutdown(vio)
Definition: violite.h:300
Vio & operator=(const Vio &)=delete
Definition: violite.h:129
my_socket vio_fd(MYSQL_VIO vio)
struct sockaddr_storage local
Definition: violite.h:334
bool inactive
Definition: violite.h:332
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:1197