Commit 6f4b5ef6 authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Fix "can't bind to address" error reporting.

Report the actual port used for the listening attempt instead of
server.port.

Originally, Redis would just listen on server.port.
But, with clustering, Redis uses a Cluster Port too,
so we can't say server.port is always where we are listening.

If you tried to launch Redis with a too-high port number (any
port where Port+10000 > 65535), Redis would refuse to start, but
only print an error saying it can't connect to the Redis port.

This patch fixes much confusions.
parent 4d5ba596
...@@ -1582,7 +1582,7 @@ int listenToPort(int port, int *fds, int *count) { ...@@ -1582,7 +1582,7 @@ int listenToPort(int port, int *fds, int *count) {
redisLog(REDIS_WARNING, redisLog(REDIS_WARNING,
"Creating Server TCP listening socket %s:%d: %s", "Creating Server TCP listening socket %s:%d: %s",
server.bindaddr[j] ? server.bindaddr[j] : "*", server.bindaddr[j] ? server.bindaddr[j] : "*",
server.port, server.neterr); port, server.neterr);
return REDIS_ERR; return REDIS_ERR;
} }
(*count)++; (*count)++;
......
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