Close client connection and log the event when the client input buffer reaches 1GB.

This commit is contained in:
antirez
2011-11-21 16:17:51 +01:00
parent 93babe4b41
commit a6e4627438
3 changed files with 11 additions and 0 deletions

View File

@ -862,6 +862,13 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) {
} else {
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);
sdsfree(ci);
freeClient(c);
return;
}
processInputBuffer(c);
}