diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db.c | 2 | ||||
-rw-r--r-- | src/multi.c | 10 | ||||
-rw-r--r-- | src/object.c | 3 | ||||
-rw-r--r-- | src/server.h | 1 |
4 files changed, 10 insertions, 6 deletions
@@ -165,7 +165,7 @@ robj *lookupKeyWriteWithFlags(redisDb *db, robj *key, int flags) { robj *lookupKeyWrite(redisDb *db, robj *key) { return lookupKeyWriteWithFlags(db, key, LOOKUP_NONE); } -static void SentReplyOnKeyMiss(client *c, robj *reply){ +void SentReplyOnKeyMiss(client *c, robj *reply){ serverAssert(sdsEncodedObject(reply)); sds rep = reply->ptr; if (sdslen(rep) > 1 && rep[0] == '-'){ diff --git a/src/multi.c b/src/multi.c index de871102a..56629fd80 100644 --- a/src/multi.c +++ b/src/multi.c @@ -179,9 +179,13 @@ void execCommand(client *c) { * A failed EXEC in the first case returns a multi bulk nil object * (technically it is not an error but a special behavior), while * in the second an EXECABORT error is returned. */ - if (c->flags & (CLIENT_DIRTY_CAS|CLIENT_DIRTY_EXEC)) { - addReply(c, c->flags & CLIENT_DIRTY_EXEC ? shared.execaborterr : - shared.nullarray[c->resp]); + if (c->flags & (CLIENT_DIRTY_CAS | CLIENT_DIRTY_EXEC)) { + if (c->flags & CLIENT_DIRTY_EXEC) { + addReplyErrorObject(c, shared.execaborterr); + } else { + addReply(c, shared.nullarray[c->resp]); + } + discardTransaction(c); return; } diff --git a/src/object.c b/src/object.c index 317e3bf56..b65430784 100644 --- a/src/object.c +++ b/src/object.c @@ -1402,8 +1402,7 @@ robj *objectCommandLookup(client *c, robj *key) { robj *objectCommandLookupOrReply(client *c, robj *key, robj *reply) { robj *o = objectCommandLookup(c,key); - - if (!o) addReply(c, reply); + if (!o) SentReplyOnKeyMiss(c, reply); return o; } diff --git a/src/server.h b/src/server.h index 7e76c0a0f..e45558f8e 100644 --- a/src/server.h +++ b/src/server.h @@ -2394,6 +2394,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags); robj *lookupKeyWriteWithFlags(redisDb *db, robj *key, int flags); robj *objectCommandLookup(client *c, robj *key); robj *objectCommandLookupOrReply(client *c, robj *key, robj *reply); +void SentReplyOnKeyMiss(client *c, robj *reply); int objectSetLRUOrLFU(robj *val, long long lfu_freq, long long lru_idle, long long lru_clock, int lru_multiplier); #define LOOKUP_NONE 0 |