提交 0a4656d6 编写于 作者: A Allan 提交者: antirez

fixed bug issue of #1213

上级 7c861340
......@@ -1468,9 +1468,12 @@ void initServer() {
for (j = 0; j < server.bindaddr_count || j == 0; j++) {
if (server.bindaddr[j] == NULL) {
/* Bind * for both IPv6 and IPv4. */
server.ipfd[0] = anetTcp6Server(server.neterr,server.port,NULL);
if (server.ipfd[0] != ANET_ERR) server.ipfd_count++;
server.ipfd[1] = anetTcpServer(server.neterr,server.port,NULL);
server.ipfd[server.ipfd_count] = anetTcp6Server(server.neterr,server.port,NULL);
if (server.ipfd[server.ipfd_count] != ANET_ERR) server.ipfd_count++;
server.ipfd[server.ipfd_count] = anetTcpServer(server.neterr,server.port,NULL);
} else if (strchr(server.bindaddr[j],':')) {
/* Bind IPv6 address. */
server.ipfd[server.ipfd_count] = anetTcp6Server(server.neterr,server.port,server.bindaddr[j]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册