Remove disabling TCP with port -1
This commit is contained in:
parent
5d10923f7b
commit
893819801d
@ -21,7 +21,6 @@ daemonize no
|
|||||||
pidfile /var/run/redis.pid
|
pidfile /var/run/redis.pid
|
||||||
|
|
||||||
# Accept connections on the specified port, default is 6379.
|
# Accept connections on the specified port, default is 6379.
|
||||||
# Use port -1 to disable listening on a network interface.
|
|
||||||
port 6379
|
port 6379
|
||||||
|
|
||||||
# If you want you can bind a single interface, if the bind option is not
|
# If you want you can bind a single interface, if the bind option is not
|
||||||
|
@ -66,9 +66,7 @@ void loadServerConfig(char *filename) {
|
|||||||
}
|
}
|
||||||
} else if (!strcasecmp(argv[0],"port") && argc == 2) {
|
} else if (!strcasecmp(argv[0],"port") && argc == 2) {
|
||||||
server.port = atoi(argv[1]);
|
server.port = atoi(argv[1]);
|
||||||
if (server.port != -1 &&
|
if (server.port < 1 || server.port > 65535) {
|
||||||
(server.port < 1 || server.port > 65535))
|
|
||||||
{
|
|
||||||
err = "Invalid port"; goto loaderr;
|
err = "Invalid port"; goto loaderr;
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(argv[0],"bind") && argc == 2) {
|
} else if (!strcasecmp(argv[0],"bind") && argc == 2) {
|
||||||
|
@ -776,13 +776,11 @@ void initServer() {
|
|||||||
createSharedObjects();
|
createSharedObjects();
|
||||||
server.el = aeCreateEventLoop();
|
server.el = aeCreateEventLoop();
|
||||||
server.db = zmalloc(sizeof(redisDb)*server.dbnum);
|
server.db = zmalloc(sizeof(redisDb)*server.dbnum);
|
||||||
if (server.port > 0) {
|
|
||||||
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
|
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
|
||||||
if (server.ipfd == ANET_ERR) {
|
if (server.ipfd == ANET_ERR) {
|
||||||
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
|
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (server.unixsocket != NULL) {
|
if (server.unixsocket != NULL) {
|
||||||
unlink(server.unixsocket); /* don't care if this fails */
|
unlink(server.unixsocket); /* don't care if this fails */
|
||||||
server.sofd = anetUnixServer(server.neterr,server.unixsocket);
|
server.sofd = anetUnixServer(server.neterr,server.unixsocket);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user