Permalink
Browse files

show initial querybuf bytes on querybuf overflow.

  • Loading branch information...
1 parent 241e3cf commit 0f2199ec29d98149be5c0c405865b20e9542fece @antirez committed Nov 25, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/networking.c
View
@@ -869,9 +869,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;
}

0 comments on commit 0f2199e

Please sign in to comment.