summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-09-12 17:00:50 -0700
committerjimw@mysql.com <>2005-09-12 17:00:50 -0700
commita60ed0b75d75304324c7d7ca70125a5d650033d9 (patch)
tree1ad89ca3921996790f4f78584fb66bf871991e26 /vio
parentb5dbd1c7a1807f6d0c98c131f933385d4f305b02 (diff)
parent0eec7c3cf4c36717c790cd779850e6e22303bdba (diff)
downloadmariadb-git-a60ed0b75d75304324c7d7ca70125a5d650033d9.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'vio')
-rw-r--r--vio/vio.c4
-rw-r--r--vio/vio_priv.h2
-rw-r--r--vio/viosocket.c9
-rw-r--r--vio/viossl.c9
4 files changed, 24 insertions, 0 deletions
diff --git a/vio/vio.c b/vio/vio.c
index bcf0ac032c8..e444c634c96 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -54,6 +54,7 @@ static void vio_init(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_pipe;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
@@ -73,6 +74,7 @@ static void vio_init(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_shared_memory;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
@@ -92,6 +94,7 @@ static void vio_init(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_ssl_was_interrupted;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_ssl_peer_addr;
vio->in_addr =vio_ssl_in_addr;
@@ -109,6 +112,7 @@ static void vio_init(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/vio_priv.h b/vio/vio_priv.h
index 3a75a08021d..c1c78cc6efa 100644
--- a/vio/vio_priv.h
+++ b/vio/vio_priv.h
@@ -39,6 +39,8 @@ int vio_ssl_fastsend(Vio *vio);
int vio_ssl_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */
my_bool vio_ssl_should_retry(Vio *vio);
+/* Check that operation was timed out */
+my_bool vio_ssl_was_interrupted(Vio *vio);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
/* Return last error number */
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 3b4013f4089..e0ca18539ce 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -242,6 +242,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=0;
diff --git a/vio/viossl.c b/vio/viossl.c
index fbbc545bb9b..e6af07c4b0b 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -184,6 +184,15 @@ vio_ssl_should_retry(Vio * vio __attribute__((unused)))
}
+my_bool
+vio_ssl_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_ssl_close(Vio * vio)
{
int r;