Commit f5494a42 authored by Geoff Garside's avatar Geoff Garside Committed by antirez
Browse files

Update anetTcpAccept & anetPeerToString calls.

Add the additional ip buffer length argument to function calls of
anetTcpAccept and anetPeerToString in network.c and cluster.c
parent ef839f90
...@@ -310,7 +310,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -310,7 +310,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
REDIS_NOTUSED(mask); REDIS_NOTUSED(mask);
REDIS_NOTUSED(privdata); REDIS_NOTUSED(privdata);
cfd = anetTcpAccept(server.neterr, fd, cip, &cport); cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
if (cfd == AE_ERR) { if (cfd == AE_ERR) {
redisLog(REDIS_VERBOSE,"Accepting cluster node: %s", server.neterr); redisLog(REDIS_VERBOSE,"Accepting cluster node: %s", server.neterr);
return; return;
......
...@@ -557,7 +557,7 @@ void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) { ...@@ -557,7 +557,7 @@ void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
REDIS_NOTUSED(mask); REDIS_NOTUSED(mask);
REDIS_NOTUSED(privdata); REDIS_NOTUSED(privdata);
cfd = anetTcpAccept(server.neterr, fd, cip, &cport); cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
if (cfd == AE_ERR) { if (cfd == AE_ERR) {
redisLog(REDIS_WARNING,"Accepting client connection: %s", server.neterr); redisLog(REDIS_WARNING,"Accepting client connection: %s", server.neterr);
return; return;
...@@ -1133,7 +1133,7 @@ sds getClientInfoString(redisClient *client) { ...@@ -1133,7 +1133,7 @@ sds getClientInfoString(redisClient *client) {
int emask; int emask;
if (!(client->flags & REDIS_UNIX_SOCKET)) if (!(client->flags & REDIS_UNIX_SOCKET))
anetPeerToString(client->fd,ip,&port); anetPeerToString(client->fd,ip,sizeof(ip),&port);
p = flags; p = flags;
if (client->flags & REDIS_SLAVE) { if (client->flags & REDIS_SLAVE) {
if (client->flags & REDIS_MONITOR) if (client->flags & REDIS_MONITOR)
...@@ -1214,7 +1214,7 @@ void clientCommand(redisClient *c) { ...@@ -1214,7 +1214,7 @@ void clientCommand(redisClient *c) {
int port; int port;
client = listNodeValue(ln); 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); snprintf(addr,sizeof(addr),"%s:%d",ip,port);
if (strcmp(addr,c->argv[2]->ptr) == 0) { if (strcmp(addr,c->argv[2]->ptr) == 0) {
addReply(c,shared.ok); addReply(c,shared.ok);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment