Repository: valkey-io/valkey
File: src/server.h (C/C++)

Code before:
    robj *lib_name;                          /* The client library name as set by CLIENT SETINFO. */
    robj *lib_ver;                           /* The client library version as set by CLIENT SETINFO. */
    sds peerid;                              /* Cached peer ID. */
    sds sockname;                            /* Cached connection target address. */
    time_t ctime;                            /* Client creation time. */
    list *deferred_reply;                    /* List of reply objects to be sent to the client, typically after
                                                the client has been unblocked. */
    unsigned long long deferred_reply_bytes; /* Total bytes of objects in the blocked client pending list.*/
#ifdef LOG_REQ_RES
    clientReqResInfo reqres;
#endif
} client;

/* When a command generates a lot of discrete elements to the client output buffer, it is much faster to
 * skip certain types of initialization. This type is used to indicate a client that has been initialized
 * and can be used with addWritePreparedReply* functions. A client can be cast into this type with
 * prepareClientForFutureWrites(client *c). */
typedef struct writePreparedClient writePreparedClient;

/* ACL information */
typedef struct aclInfo {
    long long user_auth_failures;             /* Auth failure counts on user level */
    long long invalid_cmd_accesses;           /* Invalid command accesses that user doesn't have permission to */
    long long invalid_key_accesses;           /* Invalid key accesses that user doesn't have permission to */
    long long invalid_channel_accesses;       /* Invalid channel accesses that user doesn't have permission to */
    long long acl_access_denied_tls_cert; /* Invalid channel accesses that user doesn't have permission to */
} aclInfo;

struct saveparam {
    time_t seconds;
    int changes;
};

struct sentinelLoadQueueEntry {
    int argc;
    sds *argv;
    int linenum;
    sds line;
};

struct sentinelConfig {
    list *pre_monitor_cfg;
    list *monitor_cfg;
    list *post_monitor_cfg;
};

struct sharedObjectsStruct {
    robj *ok, *err, *emptybulk, *czero, *cone, *pong, *space, *queued, *null[4], *nullarray[4], *emptymap[4],
        *emptyset[4], *emptyarray, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr, *outofrangeerr, *noscripterr,
        *loadingerr, *slowevalerr, *slowscripterr, *slowmoduleerr, *bgsaveerr, *primarydownerr, *roreplicaerr,
        *loadingerr_variants[2], *slowevalerr_variants[2], *slowscripterr_variants[2], *slowmoduleerr_variants[2],

Review comment (bug):
The comment looks wrong. Copy-pasted from previous line?

Idea:

```suggestion
    long long acl_access_denied_tls_cert; /* TLS clients with cert not matching any exisiting user. */
```

Alternatively, TLS cert auto-authentication failure

Code after:
    robj *lib_name;                          /* The client library name as set by CLIENT SETINFO. */
    robj *lib_ver;                           /* The client library version as set by CLIENT SETINFO. */
    sds peerid;                              /* Cached peer ID. */
    sds sockname;                            /* Cached connection target address. */
    time_t ctime;                            /* Client creation time. */
    list *deferred_reply;                    /* List of reply objects to be sent to the client, typically after
                                                the client has been unblocked. */
    unsigned long long deferred_reply_bytes; /* Total bytes of objects in the blocked client pending list.*/
#ifdef LOG_REQ_RES
    clientReqResInfo reqres;
#endif
} client;

/* When a command generates a lot of discrete elements to the client output buffer, it is much faster to
 * skip certain types of initialization. This type is used to indicate a client that has been initialized
 * and can be used with addWritePreparedReply* functions. A client can be cast into this type with
 * prepareClientForFutureWrites(client *c). */
typedef struct writePreparedClient writePreparedClient;

/* ACL information */
typedef struct aclInfo {
    long long user_auth_failures;         /* Auth failure counts on user level */
    long long invalid_cmd_accesses;       /* Invalid command accesses that user doesn't have permission to */
    long long invalid_key_accesses;       /* Invalid key accesses that user doesn't have permission to */
    long long invalid_channel_accesses;   /* Invalid channel accesses that user doesn't have permission to */
    long long acl_access_denied_tls_cert; /* TLS clients with cert not matching any existing user. */
} aclInfo;

struct saveparam {
    time_t seconds;
    int changes;
};

struct sentinelLoadQueueEntry {
    int argc;
    sds *argv;
    int linenum;
    sds line;
};

struct sentinelConfig {
    list *pre_monitor_cfg;
    list *monitor_cfg;
    list *post_monitor_cfg;
};

struct sharedObjectsStruct {
    robj *ok, *err, *emptybulk, *czero, *cone, *pong, *space, *queued, *null[4], *nullarray[4], *emptymap[4],
        *emptyset[4], *emptyarray, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr, *outofrangeerr, *noscripterr,
        *loadingerr, *slowevalerr, *slowscripterr, *slowmoduleerr, *bgsaveerr, *primarydownerr, *roreplicaerr,
        *loadingerr_variants[2], *slowevalerr_variants[2], *slowscripterr_variants[2], *slowmoduleerr_variants[2],