summaryrefslogtreecommitdiff
path: root/src/connection.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2021-11-08 16:09:33 +0200
committerGitHub <noreply@github.com>2021-11-08 16:09:33 +0200
commita1aba4bf754fc6c650d37447b689ac4dea6baebf (patch)
treec8a0275327b1c59ae7b0a1d6bfe607e0cc06e249 /src/connection.c
parent48d870aed1a5c392f3c1b59db48bc15f9f43b963 (diff)
downloadredis-a1aba4bf754fc6c650d37447b689ac4dea6baebf.tar.gz
Fix EINTR test failures. (#9751)
* Clean up EINTR handling so EINTR will not change connection state to begin with. * On TLS, catch EINTR and return it as-is before going through OpenSSL error handling (which seems to not distinguish it from EAGAIN).
Diffstat (limited to 'src/connection.c')
-rw-r--r--src/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/connection.c b/src/connection.c
index a59463220..3a17d983d 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -171,7 +171,7 @@ static int connSocketWrite(connection *conn, const void *data, size_t data_len)
/* Don't overwrite the state of a connection that is not already
* connected, not to mess with handler callbacks.
*/
- if (conn->state == CONN_STATE_CONNECTED)
+ if (errno != EINTR && conn->state == CONN_STATE_CONNECTED)
conn->state = CONN_STATE_ERROR;
}
@@ -188,7 +188,7 @@ static int connSocketRead(connection *conn, void *buf, size_t buf_len) {
/* Don't overwrite the state of a connection that is not already
* connected, not to mess with handler callbacks.
*/
- if (conn->state == CONN_STATE_CONNECTED)
+ if (errno != EINTR && conn->state == CONN_STATE_CONNECTED)
conn->state = CONN_STATE_ERROR;
}