1 | /* adapted from violite.h from mysql 5.0.51 */ |
1 | /* adapted from violite.h from mysql 5.0.51 and many others */ |
2 | /* all modifications public domain */ |
2 | /* all modifications public domain */ |
3 | /* Copyright (C) 2000 MySQL AB |
3 | /* Copyright (C) 2000 MySQL AB |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
… | |
… | |
133 | }; |
133 | }; |
134 | |
134 | |
135 | |
135 | |
136 | /* HFTODO - hide this if we don't want client in embedded server */ |
136 | /* HFTODO - hide this if we don't want client in embedded server */ |
137 | /* This structure is for every connection on both sides */ |
137 | /* This structure is for every connection on both sides */ |
|
|
138 | #if defined(MARIADB_BASE_VERSION) |
|
|
139 | |
|
|
140 | #define DESC_IS_PTR 1 |
|
|
141 | typedef unsigned char uchar; |
|
|
142 | |
|
|
143 | struct st_vio |
|
|
144 | { |
|
|
145 | my_socket sd; /* my_socket - real or imaginary */ |
|
|
146 | void *m_psi; |
|
|
147 | my_bool localhost; /* Are we from localhost? */ |
|
|
148 | int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ |
|
|
149 | struct sockaddr_storage local; /* Local internet address */ |
|
|
150 | struct sockaddr_storage remote; /* Remote internet address */ |
|
|
151 | int addrLen; /* Length of remote address */ |
|
|
152 | enum enum_vio_type type; /* Type of connection */ |
|
|
153 | const char *desc; /* String description */ |
|
|
154 | char *read_buffer; /* buffer for vio_read_buff */ |
|
|
155 | char *read_pos; /* start of unfetched data in the |
|
|
156 | read buffer */ |
|
|
157 | char *read_end; /* end of unfetched data */ |
|
|
158 | struct mysql_async_context *async_context; /* For non-blocking API */ |
|
|
159 | int read_timeout; /* Timeout value (ms) for read ops. */ |
|
|
160 | int write_timeout; /* Timeout value (ms) for write ops. */ |
|
|
161 | /* function pointers. They are similar for socket/SSL/whatever */ |
|
|
162 | void (*viodelete)(Vio*); |
|
|
163 | int (*vioerrno)(Vio*); |
|
|
164 | size_t (*read)(Vio*, uchar *, size_t); |
|
|
165 | size_t (*write)(Vio*, const uchar *, size_t); |
|
|
166 | int (*timeout)(Vio*, uint, my_bool); |
|
|
167 | int (*vioblocking)(Vio*, my_bool, my_bool *); |
|
|
168 | my_bool (*is_blocking)(Vio*); |
|
|
169 | int (*viokeepalive)(Vio*, my_bool); |
|
|
170 | int (*fastsend)(Vio*); |
|
|
171 | my_bool (*peer_addr)(Vio*, char *, uint16*, size_t); |
|
|
172 | void (*in_addr)(Vio*, struct sockaddr_storage*); |
|
|
173 | my_bool (*should_retry)(Vio*); |
|
|
174 | my_bool (*was_timeout)(Vio*); |
|
|
175 | int (*vioclose)(Vio*); |
|
|
176 | my_bool (*is_connected)(Vio*); |
|
|
177 | int (*shutdown)(Vio *, int); |
|
|
178 | my_bool (*has_data) (Vio*); |
|
|
179 | }; |
|
|
180 | |
138 | #if MYSQL_VERSION_ID < 50500 |
181 | #elif MYSQL_VERSION_ID < 50500 |
139 | |
182 | |
140 | struct st_vio |
183 | struct st_vio |
141 | { |
184 | { |
142 | my_socket sd; /* my_socket - real or imaginary */ |
185 | my_socket sd; /* my_socket - real or imaginary */ |
143 | HANDLE hPipe; |
186 | HANDLE hPipe; |