]> git.saurik.com Git - redis.git/commitdiff
show initial querybuf bytes on querybuf overflow.
authorantirez <antirez@gmail.com>
Fri, 25 Nov 2011 16:08:25 +0000 (17:08 +0100)
committerantirez <antirez@gmail.com>
Mon, 28 Nov 2011 10:12:55 +0000 (11:12 +0100)
src/networking.c

index f0da4010fe43a109461217eefa2baa76db2ec311..f1c6627ce7e356311539397a83b8394b9a35b9e8 100644 (file)
@@ -911,9 +911,12 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) {
         return;
     }
     if (sdslen(c->querybuf) > server.client_max_querybuf_len) {
-        sds ci = getClientInfoString(c);
-        redisLog(REDIS_WARNING,"Closing client that reached max query buffer length: %s", ci);
+        sds ci = getClientInfoString(c), bytes = sdsempty();
+
+        bytes = sdscatrepr(bytes,c->querybuf,64);
+        redisLog(REDIS_WARNING,"Closing client that reached max query buffer length: %s (qbuf initial bytes: %s)", ci, bytes);
         sdsfree(ci);
+        sdsfree(bytes);
         freeClient(c);
         return;
     }