mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
fix the fix for the TCP binding.
This commit attempts to fix a problem with PR #3467.
This commit is contained in:
parent
92038286e8
commit
f9624813af
25
src/server.c
25
src/server.c
@ -1644,19 +1644,24 @@ int listenToPort(int port, int *fds, int *count) {
|
|||||||
if (fds[*count] != ANET_ERR) {
|
if (fds[*count] != ANET_ERR) {
|
||||||
anetNonBlock(NULL,fds[*count]);
|
anetNonBlock(NULL,fds[*count]);
|
||||||
(*count)++;
|
(*count)++;
|
||||||
} else if (errno == EAFNOSUPPORT)
|
} else if (errno == EAFNOSUPPORT) {
|
||||||
unsupported++;
|
unsupported++;
|
||||||
|
serverLog(LL_WARNING,"Not listening to IPv6: unsupproted");
|
||||||
|
}
|
||||||
|
|
||||||
/* Bind the IPv4 address as well. */
|
if (*count == 1 || unsupported) {
|
||||||
fds[*count] = anetTcpServer(server.neterr,port,NULL,
|
/* Bind the IPv4 address as well. */
|
||||||
server.tcp_backlog);
|
fds[*count] = anetTcpServer(server.neterr,port,NULL,
|
||||||
if (fds[*count] != ANET_ERR) {
|
server.tcp_backlog);
|
||||||
anetNonBlock(NULL,fds[*count]);
|
if (fds[*count] != ANET_ERR) {
|
||||||
(*count)++;
|
anetNonBlock(NULL,fds[*count]);
|
||||||
} else if (errno == EAFNOSUPPORT)
|
(*count)++;
|
||||||
unsupported++;
|
} else if (errno == EAFNOSUPPORT) {
|
||||||
|
unsupported++;
|
||||||
|
serverLog(LL_WARNING,"Not listening to IPv4: unsupproted");
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Exit the loop if we were able to bind * on IPv4 and IPv6,
|
/* Exit the loop if we were able to bind * on IPv4 and IPv6,
|
||||||
* or if one is unsupported by th OS.
|
|
||||||
* otherwise fds[*count] will be ANET_ERR and we'll print an
|
* otherwise fds[*count] will be ANET_ERR and we'll print an
|
||||||
* error and return to the caller with an error. */
|
* error and return to the caller with an error. */
|
||||||
if (*count + unsupported == 2) break;
|
if (*count + unsupported == 2) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user