RESP3: put RESP version in the client structure.

This commit is contained in:
antirez 2018-11-21 11:53:18 +01:00
parent f44e00b691
commit 1ac6926647
2 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,7 @@ client *createClient(int fd) {
uint64_t client_id;
atomicGetIncr(server.next_client_id,client_id,1);
c->id = client_id;
c->resp = 2;
c->fd = fd;
c->name = NULL;
c->bufpos = 0;

View File

@ -712,6 +712,7 @@ typedef struct readyList {
typedef struct client {
uint64_t id; /* Client incremental unique ID. */
int fd; /* Client socket. */
int resp; /* RESP protocol version. Can be 2 or 3. */
redisDb *db; /* Pointer to currently SELECTed DB. */
robj *name; /* As set by CLIENT SETNAME. */
sds querybuf; /* Buffer we use to accumulate client queries. */