diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2022-11-30 22:23:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 22:23:00 +0200 |
commit | 6c98a97bf4f0886a0dcbeaaecbd395c4e8ecb657 (patch) | |
tree | ee79fd721bf8d78d46ca3a3f8aef0dc0e80bfc41 /src/replication.c | |
parent | 7dfd7b9197bbe216912049eebecbda3f1684925e (diff) | |
download | redis-tls-conn-errors.tar.gz |
Improve TLS error handling. (#11557)tls-conn-errors
* Remove duplicate code, propagating SSL errors into connection state.
* Add missing error handling in synchronous IO functions.
* Fix connection error reporting in some replication flows.
Diffstat (limited to 'src/replication.c')
-rw-r--r-- | src/replication.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/replication.c b/src/replication.c index 3674bea05..a57cd8528 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1837,7 +1837,7 @@ void readSyncBulkPayload(connection *conn) { if (nread == -1) { serverLog(LL_WARNING, "I/O error reading bulk count from MASTER: %s", - strerror(errno)); + connGetLastError(conn)); goto error; } else { /* nread here is returned by connSyncReadLine(), which calls syncReadLine() and @@ -1909,7 +1909,7 @@ void readSyncBulkPayload(connection *conn) { return; } serverLog(LL_WARNING,"I/O error trying to sync with MASTER: %s", - (nread == -1) ? strerror(errno) : "connection lost"); + (nread == -1) ? connGetLastError(conn) : "connection lost"); cancelReplicationHandshake(1); return; } @@ -2254,7 +2254,7 @@ char *receiveSynchronousResponse(connection *conn) { /* Read the reply from the server. */ if (connSyncReadLine(conn,buf,sizeof(buf),server.repl_syncio_timeout*1000) == -1) { - serverLog(LL_WARNING, "Failed to read response from the server: %s", strerror(errno)); + serverLog(LL_WARNING, "Failed to read response from the server: %s", connGetLastError(conn)); return NULL; } server.repl_transfer_lastio = server.unixtime; @@ -2815,7 +2815,7 @@ void syncWithMaster(connection *conn) { serverLog(LL_NOTICE,"Retrying with SYNC..."); if (connSyncWrite(conn,"SYNC\r\n",6,server.repl_syncio_timeout*1000) == -1) { serverLog(LL_WARNING,"I/O error writing to MASTER: %s", - strerror(errno)); + connGetLastError(conn)); goto error; } } |