From 893819801d4952e208e83dde364bfc5021465e45 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 13 Oct 2010 17:18:58 +0200 Subject: [PATCH] Remove disabling TCP with port -1 --- redis.conf | 1 - src/config.c | 4 +--- src/redis.c | 10 ++++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/redis.conf b/redis.conf index a01bdd15..3a2b45e2 100644 --- a/redis.conf +++ b/redis.conf @@ -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 diff --git a/src/config.c b/src/config.c index 6b281a14..eeec9e8c 100644 --- a/src/config.c +++ b/src/config.c @@ -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) { diff --git a/src/redis.c b/src/redis.c index 0c3d0ce9..8bff97b5 100644 --- a/src/redis.c +++ b/src/redis.c @@ -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 */ -- 2.45.2