]> git.saurik.com Git - redis.git/blobdiff - src/aof.c
Don't build a reply when replaying the AOF
[redis.git] / src / aof.c
index 8f2dc96f3cd5a22ad0641b3593d5c03ea995d4ce..1ed2363ad8efd9309e3f8a68386fcfb5cec58330 100644 (file)
--- a/src/aof.c
+++ b/src/aof.c
@@ -272,12 +272,14 @@ int loadAppendOnlyFile(char *filename) {
         fakeClient->argc = argc;
         fakeClient->argv = argv;
         cmd->proc(fakeClient);
-        /* Discard the reply objects list from the fake client */
-        while(listLength(fakeClient->reply))
-            listDelNode(fakeClient->reply,listFirst(fakeClient->reply));
+
+        /* The fake client should not have a reply */
+        redisAssert(fakeClient->bufpos == 0 && listLength(fakeClient->reply) == 0);
+
         /* Clean up, ready for the next command */
         for (j = 0; j < argc; j++) decrRefCount(argv[j]);
         zfree(argv);
+
         /* Handle swapping while loading big datasets when VM is on */
         force_swapout = 0;
         if ((zmalloc_used_memory() - server.vm_max_memory) > 1024*1024*32)