Commit 1ac69266 authored by antirez's avatar antirez
Browse files

RESP3: put RESP version in the client structure.

parent f44e00b6
...@@ -107,6 +107,7 @@ client *createClient(int fd) { ...@@ -107,6 +107,7 @@ client *createClient(int fd) {
uint64_t client_id; uint64_t client_id;
atomicGetIncr(server.next_client_id,client_id,1); atomicGetIncr(server.next_client_id,client_id,1);
c->id = client_id; c->id = client_id;
c->resp = 2;
c->fd = fd; c->fd = fd;
c->name = NULL; c->name = NULL;
c->bufpos = 0; c->bufpos = 0;
......
...@@ -712,6 +712,7 @@ typedef struct readyList { ...@@ -712,6 +712,7 @@ typedef struct readyList {
typedef struct client { typedef struct client {
uint64_t id; /* Client incremental unique ID. */ uint64_t id; /* Client incremental unique ID. */
int fd; /* Client socket. */ int fd; /* Client socket. */
int resp; /* RESP protocol version. Can be 2 or 3. */
redisDb *db; /* Pointer to currently SELECTed DB. */ redisDb *db; /* Pointer to currently SELECTed DB. */
robj *name; /* As set by CLIENT SETNAME. */ robj *name; /* As set by CLIENT SETNAME. */
sds querybuf; /* Buffer we use to accumulate client queries. */ sds querybuf; /* Buffer we use to accumulate client queries. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment