Update src/socket.c

Co-authored-by: Arthur Lee <arthurkiller@users.noreply.github.com>
Signed-off-by: kukey <ch_1159@hotmail.com>
This commit is contained in:
kukey 2025-12-15 10:56:49 +08:00 committed by GitHub
parent c592be96b6
commit 23acc71d2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ static int connSocketConnect(connection *conn,
conn->state = CONN_STATE_CONNECTING;
conn->conn_handler = connect_handler;
aeCreateFileEvent(server.el, conn->fd, AE_WRITABLE, conn->type->ae_handler, conn);
if (aeCreateFileEvent(server.el, conn->fd, AE_WRITABLE, conn->type->ae_handler, conn) == AE_ERR) {
conn->state = CONN_STATE_ERROR;
conn->last_errno = errno;
return C_ERR
}
return C_OK;
}