dovecot-2.2: Removed SET_IN_PORT_ZERO - SET_IN_PORT now always a...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 3 11:11:37 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/f17065f4f9f2
changeset: 19077:f17065f4f9f2
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 03 14:10:36 2015 +0300
description:
Removed SET_IN_PORT_ZERO - SET_IN_PORT now always allows zeros as well.
A zero in all the port settings means that the port is disabled, which is
also the default. So it shouldn't be an error to explicitly set it to zero
in the config file.

diffstat:

 src/config/config-request.c                      |   4 +---
 src/lib-settings/settings-parser.c               |  22 +---------------------
 src/lib-settings/settings-parser.h               |   1 -
 src/master/master-settings.c                     |   2 +-
 src/replication/aggregator/aggregator-settings.c |   2 +-
 5 files changed, 4 insertions(+), 27 deletions(-)

diffs (123 lines):

diff -r 29e0a3ea7497 -r f17065f4f9f2 src/config/config-request.c
--- a/src/config/config-request.c	Thu Sep 03 14:01:57 2015 +0300
+++ b/src/config/config-request.c	Thu Sep 03 14:10:36 2015 +0300
@@ -116,8 +116,7 @@
 		}
 		break;
 	}
-	case SET_IN_PORT:
-	case SET_IN_PORT_ZERO: {
+	case SET_IN_PORT: {
 		const in_port_t *val = value, *dval = default_value;
 
 		if (dump_default || dval == NULL || *val != *dval)
@@ -254,7 +253,6 @@
 		case SET_UINT_OCT:
 		case SET_TIME:
 		case SET_IN_PORT:
-		case SET_IN_PORT_ZERO:
 		case SET_STR_VARS:
 		case SET_STR:
 		case SET_ENUM:
diff -r 29e0a3ea7497 -r f17065f4f9f2 src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c	Thu Sep 03 14:01:57 2015 +0300
+++ b/src/lib-settings/settings-parser.c	Thu Sep 03 14:10:36 2015 +0300
@@ -583,18 +583,6 @@
 }
 
 static int
-get_in_port(struct setting_parser_context *ctx, const char *value,
-	 in_port_t *result_r)
-{
-	if (net_str2port(value, result_r) < 0) {
-		ctx->error = p_strdup_printf(ctx->parser_pool,
-			"Invalid port number %s", value);
-		return -1;
-	}
-	return 0;
-}
-
-static int
 get_in_port_zero(struct setting_parser_context *ctx, const char *value,
 	 in_port_t *result_r)
 {
@@ -655,10 +643,6 @@
 		}
 		break;
 	case SET_IN_PORT:
-		if (get_in_port(ctx, value, (in_port_t *)ptr) < 0)
-			return -1;
-		break;
-	case SET_IN_PORT_ZERO:
 		if (get_in_port_zero(ctx, value, (in_port_t *)ptr) < 0)
 			return -1;
 		break;
@@ -1264,7 +1248,6 @@
 		case SET_TIME:
 		case SET_SIZE:
 		case SET_IN_PORT:
-		case SET_IN_PORT_ZERO:
 		case SET_STR:
 		case SET_ENUM:
 		case SET_STRLIST:
@@ -1361,7 +1344,6 @@
 		case SET_TIME:
 		case SET_SIZE:
 		case SET_IN_PORT:
-		case SET_IN_PORT_ZERO:
 		case SET_STR:
 		case SET_ENUM:
 		case SET_STRLIST:
@@ -1446,8 +1428,7 @@
 		*dest_size = *src_size;
 		break;
 	}
-	case SET_IN_PORT:
-	case SET_IN_PORT_ZERO: {
+	case SET_IN_PORT: {
 		const in_port_t *src_size = src;
 		in_port_t *dest_size = dest;
 
@@ -1568,7 +1549,6 @@
 		case SET_TIME:
 		case SET_SIZE:
 		case SET_IN_PORT:
-		case SET_IN_PORT_ZERO:
 		case SET_STR_VARS:
 		case SET_STR:
 		case SET_ENUM:
diff -r 29e0a3ea7497 -r f17065f4f9f2 src/lib-settings/settings-parser.h
--- a/src/lib-settings/settings-parser.h	Thu Sep 03 14:01:57 2015 +0300
+++ b/src/lib-settings/settings-parser.h	Thu Sep 03 14:10:36 2015 +0300
@@ -24,7 +24,6 @@
 	SET_TIME,
 	SET_SIZE,
 	SET_IN_PORT, /* internet port */
-	SET_IN_PORT_ZERO, /* internet port */
 	SET_STR,
 	SET_STR_VARS, /* string with %variables */
 	SET_ENUM,
diff -r 29e0a3ea7497 -r f17065f4f9f2 src/master/master-settings.c
--- a/src/master/master-settings.c	Thu Sep 03 14:01:57 2015 +0300
+++ b/src/master/master-settings.c	Thu Sep 03 14:10:36 2015 +0300
@@ -62,7 +62,7 @@
 static const struct setting_define inet_listener_setting_defines[] = {
 	DEF(SET_STR, name),
 	DEF(SET_STR, address),
-	DEF(SET_IN_PORT_ZERO, port),
+	DEF(SET_IN_PORT, port),
 	DEF(SET_BOOL, ssl),
 	DEF(SET_BOOL, reuse_port),
 	DEF(SET_BOOL, haproxy),
diff -r 29e0a3ea7497 -r f17065f4f9f2 src/replication/aggregator/aggregator-settings.c
--- a/src/replication/aggregator/aggregator-settings.c	Thu Sep 03 14:01:57 2015 +0300
+++ b/src/replication/aggregator/aggregator-settings.c	Thu Sep 03 14:10:36 2015 +0300
@@ -61,7 +61,7 @@
 
 static const struct setting_define aggregator_setting_defines[] = {
 	DEF(SET_STR, replicator_host),
-	DEF(SET_IN_PORT_ZERO, replicator_port),
+	DEF(SET_IN_PORT, replicator_port),
 
 	SETTING_DEFINE_LIST_END
 };


More information about the dovecot-cvs mailing list