diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-11-10 17:36:38 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-11-10 17:36:38 -0200 |
commit | 17871ade9a47d1c2e34187c0be9c2cb880d29caa (patch) | |
tree | cd2a6e4896a743f9dc89d6b6b5273f487ba04ccb /include/violite.h | |
parent | 80582b000f5cd5f6dfb24bed45df907b2c96ab02 (diff) | |
download | mariadb-git-17871ade9a47d1c2e34187c0be9c2cb880d29caa.tar.gz |
Backport of Bug#41860 to mysql-next-mr
------------------------------------------------------------
revno: 3317
revision-id: davi.arnaut@sun.com-20090522170916-fzc5ca3tjs9roy1t
parent: patrick.crews@sun.com-20090522152933-ole8s3suy4zqyvku
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 41860-6.0
timestamp: Fri 2009-05-22 14:09:16 -0300
message:
Bug#41860: Without Windows named pipe
The problem was that the patch for Bug#10374 broke named pipe
and shared memory transports on Windows due to a failure to
implement a dummy poll method for transports other than BSD
sockets. Another problem was that mysqltest lacked support
for named pipe and shared memory connections, which lead to
misleading test cases that were supposed run common queries
over both transports.
The solution is to properly implement, at the VIO layer, the
poll and is_connected methods. The is_connected method is
implemented for every suppported transport and the poll one
only where it makes sense. Furthermore, support for named pipe
and shared memory connections is added to mysqltest as to
enable testing of both transports using the test suite.
client/mysqltest.cc:
Add support for named pipe and shared memory connections.
include/violite.h:
Move private functions to vio/vio_priv.h
Add poll_read and is_connected methods.
mysql-test/t/named_pipe.test:
Run tests over a named pipe connection.
mysql-test/t/shm.test:
Run tests over a shared memory connection.
sql/item_func.cc:
Rename method.
sql/sql_class.cc:
Remove higher-level vio_is_connected implementation.
sql/sql_class.h:
Rename vio_is_connected to not conflict with the vio one.
Verify that there is a valid vio.
vio/vio.c:
Add poll_read and is_connected methods.
vio/vio_priv.h:
Add private functions.
vio/viosocket.c:
Implement the is_connected method for the various transports.
Diffstat (limited to 'include/violite.h')
-rw-r--r-- | include/violite.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/include/violite.h b/include/violite.h index 0e07e1c69ca..395feb4e0df 100644 --- a/include/violite.h +++ b/include/violite.h @@ -51,9 +51,6 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE event_client_wrote, HANDLE event_client_read, HANDLE event_conn_closed); -size_t vio_read_pipe(Vio *vio, uchar * buf, size_t size); -size_t vio_write_pipe(Vio *vio, const uchar * buf, size_t size); -int vio_close_pipe(Vio * vio); #else #define HANDLE void * #endif /* __WIN__ */ @@ -87,8 +84,8 @@ my_socket vio_fd(Vio*vio); my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port); /* Remotes in_addr */ void vio_in_addr(Vio *vio, struct in_addr *in); -my_bool vio_poll_read(Vio *vio,uint timeout); -my_bool vio_peek_read(Vio *vio, uint *bytes); +my_bool vio_poll_read(Vio *vio, uint timeout); +my_bool vio_is_connected(Vio *vio); #ifdef HAVE_OPENSSL #include <openssl/opensslv.h> @@ -137,12 +134,6 @@ struct st_VioSSLFd void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); #endif /* HAVE_OPENSSL */ -#ifdef HAVE_SMEM -size_t vio_read_shared_memory(Vio *vio, uchar * buf, size_t size); -size_t vio_write_shared_memory(Vio *vio, const uchar * buf, size_t size); -int vio_close_shared_memory(Vio * vio); -#endif - void vio_end(void); #ifdef __cplusplus @@ -165,6 +156,8 @@ void vio_end(void); #define vio_peer_addr(vio, buf, prt) (vio)->peer_addr(vio, buf, prt) #define vio_in_addr(vio, in) (vio)->in_addr(vio, in) #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) */ /* This enumerator is used in parser - should be always visible */ @@ -209,6 +202,8 @@ struct st_vio my_bool (*was_interrupted)(Vio*); int (*vioclose)(Vio*); void (*timeout)(Vio*, unsigned int which, unsigned int timeout); + my_bool (*poll_read)(Vio *vio, uint timeout); + my_bool (*is_connected)(Vio*); #ifdef HAVE_OPENSSL void *ssl_arg; #endif |