diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2020-07-28 11:32:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 11:32:47 +0300 |
commit | 784ceeb90d84bbc49fc2f2e2e6c7b9fae2524bd5 (patch) | |
tree | 71afc0aec88a311e3720dcc9074fea2b77f23592 /src/connection.c | |
parent | 109b5ccdcd6e6b8cecdaeb13a246bc49ce7a61f4 (diff) | |
download | redis-784ceeb90d84bbc49fc2f2e2e6c7b9fae2524bd5.tar.gz |
TLS: Propagate and handle SSL_new() failures. (#7576)
The connection API may create an accepted connection object in an error
state, and callers are expected to check it before attempting to use it.
Co-authored-by: mrpre <mrpre@163.com>
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/connection.c b/src/connection.c index 2015c9195..09fa12f2a 100644 --- a/src/connection.c +++ b/src/connection.c @@ -85,8 +85,12 @@ connection *connCreateSocket() { /* Create a new socket-type connection that is already associated with * an accepted connection. * - * The socket is not read for I/O until connAccept() was called and + * The socket is not ready for I/O until connAccept() was called and * invoked the connection-level accept handler. + * + * Callers should use connGetState() and verify the created connection + * is not in an error state (which is not possible for a socket connection, + * but could but possible with other protocols). */ connection *connCreateAcceptedSocket(int fd) { connection *conn = connCreateSocket(); |