mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
All IP string repr buffers are now REDIS_IP_STR_LEN bytes.
This commit is contained in:
parent
f19e267e9a
commit
631d656a94
@ -306,7 +306,7 @@ void freeClusterLink(clusterLink *link) {
|
|||||||
|
|
||||||
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||||
int cport, cfd;
|
int cport, cfd;
|
||||||
char cip[128]; /* Could use INET6_ADDRSTRLEN here, but its smaller */
|
char cip[REDIS_IP_STR_LEN];
|
||||||
clusterLink *link;
|
clusterLink *link;
|
||||||
REDIS_NOTUSED(el);
|
REDIS_NOTUSED(el);
|
||||||
REDIS_NOTUSED(mask);
|
REDIS_NOTUSED(mask);
|
||||||
|
@ -552,7 +552,7 @@ static void acceptCommonHandler(int fd, int flags) {
|
|||||||
|
|
||||||
void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||||
int cport, cfd;
|
int cport, cfd;
|
||||||
char cip[128]; /* Could use INET6_ADDRSTRLEN here, but its smaller */
|
char cip[REDIS_IP_STR_LEN];
|
||||||
REDIS_NOTUSED(el);
|
REDIS_NOTUSED(el);
|
||||||
REDIS_NOTUSED(mask);
|
REDIS_NOTUSED(mask);
|
||||||
REDIS_NOTUSED(privdata);
|
REDIS_NOTUSED(privdata);
|
||||||
@ -1210,8 +1210,7 @@ void clientCommand(redisClient *c) {
|
|||||||
} else if (!strcasecmp(c->argv[1]->ptr,"kill") && c->argc == 3) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"kill") && c->argc == 3) {
|
||||||
listRewind(server.clients,&li);
|
listRewind(server.clients,&li);
|
||||||
while ((ln = listNext(&li)) != NULL) {
|
while ((ln = listNext(&li)) != NULL) {
|
||||||
/* addr size 64 > INET6_ADDRSTRLEN + : + strlen("65535") */
|
char ip[REDIS_IP_STR_LEN], addr[REDIS_IP_STR_LEN+64];
|
||||||
char ip[INET6_ADDRSTRLEN], addr[64];
|
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
client = listNodeValue(ln);
|
client = listNodeValue(ln);
|
||||||
|
@ -2435,7 +2435,7 @@ sds genRedisInfoString(char *section) {
|
|||||||
while((ln = listNext(&li))) {
|
while((ln = listNext(&li))) {
|
||||||
redisClient *slave = listNodeValue(ln);
|
redisClient *slave = listNodeValue(ln);
|
||||||
char *state = NULL;
|
char *state = NULL;
|
||||||
char ip[INET6_ADDRSTRLEN];
|
char ip[REDIS_IP_STR_LEN];
|
||||||
int port;
|
int port;
|
||||||
long lag = 0;
|
long lag = 0;
|
||||||
|
|
||||||
|
@ -1837,7 +1837,7 @@ void sentinelPingInstance(sentinelRedisInstance *ri) {
|
|||||||
(now - ri->last_pub_time) > SENTINEL_PUBLISH_PERIOD)
|
(now - ri->last_pub_time) > SENTINEL_PUBLISH_PERIOD)
|
||||||
{
|
{
|
||||||
/* PUBLISH hello messages only to masters. */
|
/* PUBLISH hello messages only to masters. */
|
||||||
char ip[INET6_ADDRSTRLEN];
|
char ip[REDIS_IP_STR_LEN];
|
||||||
if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) != -1) {
|
if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) != -1) {
|
||||||
char myaddr[128];
|
char myaddr[128];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user