summaryrefslogtreecommitdiff
path: root/src/connection.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2020-07-28 11:32:47 +0300
committerGitHub <noreply@github.com>2020-07-28 11:32:47 +0300
commit784ceeb90d84bbc49fc2f2e2e6c7b9fae2524bd5 (patch)
tree71afc0aec88a311e3720dcc9074fea2b77f23592 /src/connection.c
parent109b5ccdcd6e6b8cecdaeb13a246bc49ce7a61f4 (diff)
downloadredis-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.c6
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();