summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-09-18 22:02:06 +0400
committerunknown <kroki/tomash@moonlight.intranet>2006-09-18 22:02:06 +0400
commit0b2a28f5cf69237f501b075dd3cfde318768fce8 (patch)
tree239a22917b95abda36af68025cb1329170dc0517 /include
parentdcb665900136fb4015589680c612add8abf1deca (diff)
downloadmariadb-git-0b2a28f5cf69237f501b075dd3cfde318768fce8.tar.gz
BUG#9678: Client library hangs after network communication failure
(back-port to 4.0) Socket timeouts in client library were used only on Windows. Additionally, in 4.0 write operations erroneously set read timeout. The solution is to use socket timeouts in client library on all systems were they are supported, and to differentiate between read and write timeouts. No test case is provided because it is impossible to simulate network failure in current test suite. include/violite.h: Add argument to vio_timeout() to determine which timeout should be set: for read (false) or for write (true). libmysqld/lib_vio.c: Add argument to vio_timeout() to determine which timeout should be set: for read (false) or for write (true). sql/net_serv.cc: Add argument to vio_timeout() to determine which timeout should be set: for read (false) or for write (true). vio/viosocket.c: Add argument to vio_timeout() to determine which timeout should be set: for read (false) or for write (true). Implement socket timeouts on POSIX systems.
Diffstat (limited to 'include')
-rw-r--r--include/violite.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/violite.h b/include/violite.h
index 23fd694d355..ee19cbd62fe 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -77,7 +77,7 @@ 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);
-void vio_timeout(Vio *vio,uint timeout);
+void vio_timeout(Vio *vio, uint which, uint timeout);
#ifdef HAVE_OPENSSL
#include <openssl/opensslv.h>
@@ -140,7 +140,7 @@ Vio *new_VioSSL(struct st_VioSSLAcceptorFd *fd, Vio *sd, int state);
#define vio_close(vio) ((vio)->vioclose)(vio)
#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, seconds) (vio)->timeout(vio, seconds)
+#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds)
#endif /* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */
/* This enumerator is used in parser - should be always visible */
@@ -180,7 +180,7 @@ struct st_vio
my_bool (*should_retry)(Vio*);
my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
- void (*timeout)(Vio*, unsigned int timeout);
+ void (*timeout)(Vio*, unsigned int which, unsigned int timeout);
void *ssl_arg;
#endif /* HAVE_VIO */
};