diff --git a/src/networking.c b/src/networking.c index 37e94706..f1ccdaf1 100644 --- a/src/networking.c +++ b/src/networking.c @@ -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; diff --git a/src/server.h b/src/server.h index 3ed559d6..603bbd2e 100644 --- a/src/server.h +++ b/src/server.h @@ -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. */