Remove disabling TCP with port -1

This commit is contained in:
Pieter Noordhuis 2010-10-13 17:18:58 +02:00
parent 5d10923f7b
commit 893819801d
3 changed files with 5 additions and 10 deletions

View File

@ -21,7 +21,6 @@ daemonize no
pidfile /var/run/redis.pid
# Accept connections on the specified port, default is 6379.
# Use port -1 to disable listening on a network interface.
port 6379
# If you want you can bind a single interface, if the bind option is not

View File

@ -66,9 +66,7 @@ void loadServerConfig(char *filename) {
}
} else if (!strcasecmp(argv[0],"port") && argc == 2) {
server.port = atoi(argv[1]);
if (server.port != -1 &&
(server.port < 1 || server.port > 65535))
{
if (server.port < 1 || server.port > 65535) {
err = "Invalid port"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"bind") && argc == 2) {

View File

@ -776,12 +776,10 @@ void initServer() {
createSharedObjects();
server.el = aeCreateEventLoop();
server.db = zmalloc(sizeof(redisDb)*server.dbnum);
if (server.port > 0) {
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
if (server.ipfd == ANET_ERR) {
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
exit(1);
}
server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr);
if (server.ipfd == ANET_ERR) {
redisLog(REDIS_WARNING, "Opening port: %s", server.neterr);
exit(1);
}
if (server.unixsocket != NULL) {
unlink(server.unixsocket); /* don't care if this fails */