summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-03 14:43:34 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-03 14:43:34 +0200
commit8e797ae26753b9bd3f8fd107175d4751953d875b (patch)
treee7a1d1b8684ae18fbc562eb4a75d976bfed50ade /vio
parentaa5095627e2619bdad7916d33d1016802a84a9e1 (diff)
downloadmariadb-git-8e797ae26753b9bd3f8fd107175d4751953d875b.tar.gz
MDEV-8014 MariaDB client can hang in an infinite loop
On EOF vio_read returns 0, it's not an error so the errno is not reset. If the previous error was EINTR the client will loop forever. See also man recv.
Diffstat (limited to 'vio')
-rw-r--r--vio/viosocket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 5576dfc48d8..e724165612c 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -137,6 +137,9 @@ int vio_socket_io_wait(Vio *vio, enum enum_vio_io_event event)
#define VIO_DONTWAIT 0
#endif
+/*
+ returns number of bytes read or -1 in case of an error
+*/
size_t vio_read(Vio *vio, uchar *buf, size_t size)
{
ssize_t ret;