CONFIG SET: accept slave-priority zero, it is valid.

This commit is contained in:
antirez 2013-05-31 19:31:36 +02:00
parent ca35de1d1f
commit b6a2878aa5

View File

@ -809,7 +809,7 @@ void configSetCommand(redisClient *c) {
server.repl_disable_tcp_nodelay = yn; server.repl_disable_tcp_nodelay = yn;
} else if (!strcasecmp(c->argv[2]->ptr,"slave-priority")) { } else if (!strcasecmp(c->argv[2]->ptr,"slave-priority")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR || if (getLongLongFromObject(o,&ll) == REDIS_ERR ||
ll <= 0) goto badfmt; ll < 0) goto badfmt;
server.slave_priority = ll; server.slave_priority = ll;
} else if (!strcasecmp(c->argv[2]->ptr,"min-slaves-to-write")) { } else if (!strcasecmp(c->argv[2]->ptr,"min-slaves-to-write")) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR || if (getLongLongFromObject(o,&ll) == REDIS_ERR ||