]> git.saurik.com Git - redis.git/blobdiff - src/networking.c
save peak memory usage as statistic and show it in INFO. Also a new INFO field was...
[redis.git] / src / networking.c
index 32c063060c10b0d9037eeda8dd64a452cedf55ba..995b910cf1b510fe49bb5dbe7f135993ad7220d5 100644 (file)
@@ -16,7 +16,6 @@ redisClient *createClient(int fd) {
 
     anetNonBlock(NULL,fd);
     anetTcpNoDelay(NULL,fd);
-    if (!c) return NULL;
     if (aeCreateFileEvent(server.el,fd,AE_READABLE,
         readQueryFromClient, c) == AE_ERR)
     {
@@ -321,7 +320,12 @@ void _addReplyLongLong(redisClient *c, long long ll, char prefix) {
 }
 
 void addReplyLongLong(redisClient *c, long long ll) {
-    _addReplyLongLong(c,ll,':');
+    if (ll == 0)
+        addReply(c,shared.czero);
+    else if (ll == 1)
+        addReply(c,shared.cone);
+    else
+        _addReplyLongLong(c,ll,':');
 }
 
 void addReplyMultiBulkLen(redisClient *c, long length) {