RESP3: most null replies converted.

This commit is contained in:
antirez
2018-11-30 09:41:54 +01:00
parent 1b7298e66a
commit 317f8b9d38
15 changed files with 66 additions and 60 deletions

View File

@ -80,7 +80,7 @@ void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire,
if ((flags & OBJ_SET_NX && lookupKeyWrite(c->db,key) != NULL) ||
(flags & OBJ_SET_XX && lookupKeyWrite(c->db,key) == NULL))
{
addReply(c, abort_reply ? abort_reply : shared.nullbulk);
addReply(c, abort_reply ? abort_reply : shared.null[c->resp]);
return;
}
setKey(c->db,key,val);
@ -157,7 +157,7 @@ void psetexCommand(client *c) {
int getGenericCommand(client *c) {
robj *o;
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL)
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp])) == NULL)
return C_OK;
if (o->type != OBJ_STRING) {
@ -289,10 +289,10 @@ void mgetCommand(client *c) {
for (j = 1; j < c->argc; j++) {
robj *o = lookupKeyRead(c->db,c->argv[j]);
if (o == NULL) {
addReply(c,shared.nullbulk);
addReplyNull(c);
} else {
if (o->type != OBJ_STRING) {
addReply(c,shared.nullbulk);
addReplyNull(c);
} else {
addReplyBulk(c,o);
}