X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/70b4b320ae1d04dd087ae9336bdd962a9615fbfe..23d3a5feef0572762cac979f70accbae7ff1eda0:/redis.c diff --git a/redis.c b/redis.c index efaeb0f1..b563c4d5 100644 --- a/redis.c +++ b/redis.c @@ -538,7 +538,7 @@ typedef struct zset { #define REDIS_SHARED_INTEGERS 10000 struct sharedObjectsStruct { - robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *pong, *space, + robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *cnegone, *pong, *space, *colon, *nullbulk, *nullmultibulk, *queued, *emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr, *outofrangeerr, *plus, @@ -1677,6 +1677,7 @@ static void createSharedObjects(void) { shared.emptybulk = createObject(REDIS_STRING,sdsnew("$0\r\n\r\n")); shared.czero = createObject(REDIS_STRING,sdsnew(":0\r\n")); shared.cone = createObject(REDIS_STRING,sdsnew(":1\r\n")); + shared.cnegone = createObject(REDIS_STRING,sdsnew(":-1\r\n")); shared.nullbulk = createObject(REDIS_STRING,sdsnew("$-1\r\n")); shared.nullmultibulk = createObject(REDIS_STRING,sdsnew("*-1\r\n")); shared.emptymultibulk = createObject(REDIS_STRING,sdsnew("*0\r\n")); @@ -5252,6 +5253,10 @@ static void pushxGenericCommand(redisClient *c, robj *refval, robj *val, int whe ziplistLen(subject->ptr) > server.list_max_ziplist_entries) listTypeConvert(subject,REDIS_ENCODING_LIST); server.dirty++; + } else { + /* Notify client of a failed insert */ + addReply(c,shared.cnegone); + return; } } else { listTypePush(subject,val,where);