summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorunknown <SergeyV@selena.>2005-08-30 19:19:28 +0400
committerunknown <SergeyV@selena.>2005-08-30 19:19:28 +0400
commita8a5e98ec6a1170173d897b0da0d39866c79c7ba (patch)
treea7b1b47c1245fde5af125171897bbad4252ebc6a /vio
parentf658a7a7c3616c5edec3b1e0a79427ca98b20fdb (diff)
downloadmariadb-git-a8a5e98ec6a1170173d897b0da0d39866c79c7ba.tar.gz
Fixes bug #5588. vio_was_interrupted() function was added to detect
read timeout properly on win32. include/my_global.h: Added win32 specific socket timeout error code. include/violite.h: Added vio_was_interrupted function that returns true if operation was not completed due to timeout. sql/mini_client.cc: added a check that replication read was not completed due to timeout. sql/net_serv.cc: net->last_errno should be equal to ER_NET_READ_INTERRUPTED in case if read operation was not completed due to timeout. vio/vio.c: added initialization code for vio_was_interrupted() function. vio/viosocket.c: Added vio_was_interrupted function that returns true if operation was not completed due to timeout.
Diffstat (limited to 'vio')
-rw-r--r--vio/vio.c2
-rw-r--r--vio/viosocket.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/vio/vio.c b/vio/vio.c
index 2b745ab3ec6..6f0587ad272 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -50,6 +50,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_ssl_fastsend;
vio->viokeepalive =vio_ssl_keepalive;
vio->should_retry =vio_ssl_should_retry;
+ vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_ssl_peer_addr;
vio->in_addr =vio_ssl_in_addr;
@@ -67,6 +68,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
vio->fastsend =vio_fastsend;
vio->viokeepalive =vio_keepalive;
vio->should_retry =vio_should_retry;
+ vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
diff --git a/vio/viosocket.c b/vio/viosocket.c
index f45c9dd98c4..7ea130c9949 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -216,6 +216,15 @@ vio_should_retry(Vio * vio __attribute__((unused)))
}
+my_bool
+vio_was_interrupted(Vio * vio __attribute__((unused)))
+{
+ int en = socket_errno;
+ return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
+ en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT);
+}
+
+
int vio_close(Vio * vio)
{
int r;