diff options
author | Geoff Garside <geoff@geoffgarside.co.uk> | 2011-06-17 19:54:17 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-07-08 15:51:37 +0200 |
commit | f5494a427e448502713c3d5a8990b37c1b1e096a (patch) | |
tree | 4cafebfc6643ebe4ba4cbd5fc1ad037a37732172 | |
parent | ef839f9006ad1d6a05bed69f58bdf7d4af7f2901 (diff) | |
download | redis-f5494a427e448502713c3d5a8990b37c1b1e096a.tar.gz |
Update anetTcpAccept & anetPeerToString calls.
Add the additional ip buffer length argument to function calls of
anetTcpAccept and anetPeerToString in network.c and cluster.c
-rw-r--r-- | src/cluster.c | 2 | ||||
-rw-r--r-- | src/networking.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cluster.c b/src/cluster.c index 1682b436d..a111c0300 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -310,7 +310,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { REDIS_NOTUSED(mask); REDIS_NOTUSED(privdata); - cfd = anetTcpAccept(server.neterr, fd, cip, &cport); + cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport); if (cfd == AE_ERR) { redisLog(REDIS_VERBOSE,"Accepting cluster node: %s", server.neterr); return; diff --git a/src/networking.c b/src/networking.c index 192ca5e0c..b493f16a8 100644 --- a/src/networking.c +++ b/src/networking.c @@ -557,7 +557,7 @@ void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) { REDIS_NOTUSED(mask); REDIS_NOTUSED(privdata); - cfd = anetTcpAccept(server.neterr, fd, cip, &cport); + cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport); if (cfd == AE_ERR) { redisLog(REDIS_WARNING,"Accepting client connection: %s", server.neterr); return; @@ -1133,7 +1133,7 @@ sds getClientInfoString(redisClient *client) { int emask; if (!(client->flags & REDIS_UNIX_SOCKET)) - anetPeerToString(client->fd,ip,&port); + anetPeerToString(client->fd,ip,sizeof(ip),&port); p = flags; if (client->flags & REDIS_SLAVE) { if (client->flags & REDIS_MONITOR) @@ -1214,7 +1214,7 @@ void clientCommand(redisClient *c) { int port; client = listNodeValue(ln); - if (anetPeerToString(client->fd,ip,&port) == -1) continue; + if (anetPeerToString(client->fd,ip,sizeof(ip),&port) == -1) continue; snprintf(addr,sizeof(addr),"%s:%d",ip,port); if (strcmp(addr,c->argv[2]->ptr) == 0) { addReply(c,shared.ok); |