Skip to content
Snippets Groups Projects
Commit c5f674d1 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge branch 'stable'

parents 9b9d9cc6 9bce8696
No related branches found
No related tags found
No related merge requests found
...@@ -231,9 +231,27 @@ ssize_t ...@@ -231,9 +231,27 @@ ssize_t
sio_read(int fd, void *buf, size_t count) sio_read(int fd, void *buf, size_t count)
{ {
ssize_t n = read(fd, buf, count); ssize_t n = read(fd, buf, count);
if (n < 0 && errno != EAGAIN && if (n < 0) {
errno != EWOULDBLOCK && errno != EINTR) if (errno == EWOULDBLOCK)
errno = EINTR;
switch (errno) {
case EAGAIN:
case EINTR:
break;
/*
* Happens typically when the client closes
* socket on timeout without reading the previous
* query's response completely. Treat the same as
* EOF.
*/
case ECONNRESET:
errno = 0;
n = 0;
break;
default:
tnt_raise(SocketError, fd, "read(%zd)", count); tnt_raise(SocketError, fd, "read(%zd)", count);
}
}
return n; return n;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment