diff options
Diffstat (limited to 'include/violite.h')
-rw-r--r-- | include/violite.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/violite.h b/include/violite.h index 093814da1c0..a026038bb0e 100644 --- a/include/violite.h +++ b/include/violite.h @@ -123,7 +123,6 @@ typedef my_socket YASSL_SOCKET_T; #include <openssl/ssl.h> #include <openssl/err.h> -#ifndef EMBEDDED_LIBRARY enum enum_ssl_init_error { SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY, @@ -149,7 +148,6 @@ struct st_VioSSLFd const char *ca_file,const char *ca_path, const char *cipher, enum enum_ssl_init_error* error); void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); -#endif /* ! EMBEDDED_LIBRARY */ #endif /* HAVE_OPENSSL */ void vio_end(void); @@ -171,12 +169,24 @@ void vio_end(void); #define vio_should_retry(vio) (vio)->should_retry(vio) #define vio_was_interrupted(vio) (vio)->was_interrupted(vio) #define vio_close(vio) ((vio)->vioclose)(vio) +#define vio_shutdown(vio,how) ((vio)->shutdown)(vio,how) #define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen) #define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds) #define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout) #define vio_is_connected(vio) (vio)->is_connected(vio) #endif /* !defined(DONT_MAP_VIO) */ +#ifdef _WIN32 +/* + Set thread id for io cancellation (required on Windows XP only, + and should to be removed if XP is no more supported) +*/ + +#define vio_set_thread_id(vio, tid) if(vio) vio->thread_id= tid +#else +#define vio_set_thread_id(vio, tid) +#endif + /* This enumerator is used in parser - should be always visible */ enum SSL_type { @@ -205,6 +215,8 @@ struct st_vio char *read_pos; /* start of unfetched data in the read buffer */ char *read_end; /* end of unfetched data */ + struct mysql_async_context *async_context; /* For non-blocking API */ + uint read_timeout, write_timeout; /* function pointers. They are similar for socket/SSL/whatever */ void (*viodelete)(Vio*); int (*vioerrno)(Vio*); @@ -222,6 +234,7 @@ struct st_vio void (*timeout)(Vio*, unsigned int which, unsigned int timeout); my_bool (*poll_read)(Vio *vio, uint timeout); my_bool (*is_connected)(Vio*); + int (*shutdown)(Vio *, int); my_bool (*has_data) (Vio*); #ifdef HAVE_OPENSSL void *ssl_arg; @@ -238,6 +251,7 @@ struct st_vio char *shared_memory_pos; #endif /* HAVE_SMEM */ #ifdef _WIN32 + DWORD thread_id; /* Used on XP only by vio_shutdown() */ OVERLAPPED pipe_overlapped; DWORD read_timeout_ms; DWORD write_timeout_ms; |