using proto-max-bulk-len in checkStringLength for SETRANGE and APPEND

This commit is contained in:
zhaozhao.zz 2018-10-30 00:38:20 +08:00 committed by zhaozhao.zz
parent 09af8447a1
commit 2e69bfe44d

View File

@ -35,8 +35,8 @@
*----------------------------------------------------------------------------*/
static int checkStringLength(client *c, long long size) {
if (size > 512*1024*1024) {
addReplyError(c,"string exceeds maximum allowed size (512MB)");
if (!(c->flags & CLIENT_MASTER) && size > server.proto_max_bulk_len) {
addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-len)");
return C_ERR;
}
return C_OK;