diff --git a/src/networking.c b/src/networking.c index 87ac701934..1ebf7eb666 100644 --- a/src/networking.c +++ b/src/networking.c @@ -3708,10 +3708,10 @@ static int parseClientFiltersOrReply(client *c, int index, clientFilter *filter) return C_ERR; } index += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "minidle") && moreargs) { + } else if (!strcasecmp(c->argv[index]->ptr, "minidle") && moreargs) { long long tmp; - if (getLongLongFromObjectOrReply(c, c->argv[i + 1], &tmp, + if (getLongLongFromObjectOrReply(c, c->argv[index + 1], &tmp, "minidle is not an integer or out of range") != C_OK) return C_ERR; if (tmp <= 0) { @@ -3720,22 +3720,22 @@ static int parseClientFiltersOrReply(client *c, int index, clientFilter *filter) } filter->min_idle = tmp; - i += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "flags") && moreargs) { - filter->flags = c->argv[i + 1]->ptr; - i += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "name") && moreargs) { - filter->name = c->argv[i + 1]->ptr; - i += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "pattern") && moreargs) { - filter->pattern = createObject(OBJ_STRING, sdsnew(c->argv[i + 1]->ptr)); - i += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "channel") && moreargs) { - filter->channel = createObject(OBJ_STRING, sdsnew(c->argv[i + 1]->ptr)); - i += 2; - } else if (!strcasecmp(c->argv[i]->ptr, "shardchannel") && moreargs) { - filter->shard_channel = createObject(OBJ_STRING, sdsnew(c->argv[i + 1]->ptr)); - i += 2; + index += 2; + } else if (!strcasecmp(c->argv[index]->ptr, "flags") && moreargs) { + filter->flags = c->argv[index + 1]->ptr; + index += 2; + } else if (!strcasecmp(c->argv[index]->ptr, "name") && moreargs) { + filter->name = c->argv[index + 1]->ptr; + index += 2; + } else if (!strcasecmp(c->argv[index]->ptr, "pattern") && moreargs) { + filter->pattern = createObject(OBJ_STRING, sdsnew(c->argv[index + 1]->ptr)); + index += 2; + } else if (!strcasecmp(c->argv[index]->ptr, "channel") && moreargs) { + filter->channel = createObject(OBJ_STRING, sdsnew(c->argv[index + 1]->ptr)); + index += 2; + } else if (!strcasecmp(c->argv[index]->ptr, "shardchannel") && moreargs) { + filter->shard_channel = createObject(OBJ_STRING, sdsnew(c->argv[index + 1]->ptr)); + index += 2; } else { addReplyErrorObject(c, shared.syntaxerr); return C_ERR;