提交 4b3c87a0 编写于 作者: M Matt Stancliff 提交者: antirez

Remove redundant IP length definition

REDIS_CLUSTER_IPLEN had the same value as
REDIS_IP_STR_LEN.  They were both #define'd
to the same INET6_ADDRSTRLEN.
上级 7c8964a8
......@@ -928,11 +928,11 @@ int clusterStartHandshake(char *ip, int port) {
if (sa.ss_family == AF_INET)
inet_ntop(AF_INET,
(void*)&(((struct sockaddr_in *)&sa)->sin_addr),
norm_ip,REDIS_CLUSTER_IPLEN);
norm_ip,REDIS_IP_STR_LEN);
else
inet_ntop(AF_INET6,
(void*)&(((struct sockaddr_in6 *)&sa)->sin6_addr),
norm_ip,REDIS_CLUSTER_IPLEN);
norm_ip,REDIS_IP_STR_LEN);
if (clusterHandshakeInProgress(norm_ip,port)) {
errno = EAGAIN;
......@@ -1034,7 +1034,7 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
/* IP -> string conversion. 'buf' is supposed to at least be 46 bytes. */
void nodeIp2String(char *buf, clusterLink *link) {
anetPeerToString(link->fd, buf, REDIS_CLUSTER_IPLEN, NULL);
anetPeerToString(link->fd, buf, REDIS_IP_STR_LEN, NULL);
}
/* Update the node address to the IP address that can be extracted
......
......@@ -10,7 +10,6 @@
#define REDIS_CLUSTER_FAIL 1 /* The cluster can't work */
#define REDIS_CLUSTER_NAMELEN 40 /* sha1 hex length */
#define REDIS_CLUSTER_PORT_INCR 10000 /* Cluster port = baseport + PORT_INCR */
#define REDIS_CLUSTER_IPLEN INET6_ADDRSTRLEN /* IPv6 address string length */
/* The following defines are amunt of time, sometimes expressed as
* multiplicators of the node timeout value (when ending with MULT). */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册