mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
CLUSTER MEET: better error messages when address is invalid.
Fixes issue #1734.
This commit is contained in:
parent
74435aba47
commit
71d0e7e0ea
@ -3287,17 +3287,19 @@ void clusterCommand(redisClient *c) {
|
||||
}
|
||||
|
||||
if (!strcasecmp(c->argv[1]->ptr,"meet") && c->argc == 4) {
|
||||
long port;
|
||||
long long port;
|
||||
|
||||
if (getLongFromObjectOrReply(c, c->argv[3], &port, NULL) != REDIS_OK) {
|
||||
addReplyError(c,"Invalid TCP port specified");
|
||||
if (getLongLongFromObject(c->argv[3], &port) != REDIS_OK) {
|
||||
addReplyErrorFormat(c,"Invalid TCP port specified: %s",
|
||||
(char*)c->argv[3]->ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (clusterStartHandshake(c->argv[2]->ptr,port) == 0 &&
|
||||
errno == EINVAL)
|
||||
{
|
||||
addReplyError(c,"Invalid node address specified");
|
||||
addReplyErrorFormat(c,"Invalid node address specified: %s:%s",
|
||||
(char*)c->argv[2]->ptr, (char*)c->argv[3]->ptr);
|
||||
} else {
|
||||
addReply(c,shared.ok);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user