summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-09-12 17:00:50 -0700
committerunknown <jimw@mysql.com>2005-09-12 17:00:50 -0700
commit8dc5c95b144e421475bf70d985a37b0ebd4d6180 (patch)
tree1ad89ca3921996790f4f78584fb66bf871991e26 /vio
parent74aeffda533697d88f19dabc86ffd8fcc19a8f7f (diff)
parentaccf5c264a4e42fb966473453aa80b1f28d87946 (diff)
downloadmariadb-git-8dc5c95b144e421475bf70d985a37b0ebd4d6180.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/violite.h: Auto merged mysql-test/r/ndb_autodiscover.result: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/ndbapi/SignalSender.cpp: Auto merged sql-common/client.c: Auto merged sql/examples/ha_archive.cc: Auto merged sql/net_serv.cc: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged vio/viossl.c: Auto merged configure.in: Resolve conflicts
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;