dovecot-2.2: config: Added support for plugins to contain multip...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jul 28 16:29:37 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/eee77416e137
changeset: 14719:eee77416e137
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jul 28 16:29:22 2012 +0300
description:
config: Added support for plugins to contain multiple service settings.
For example:

const struct service_settings *foo_settings_service_settings_array[] = {
	&foo1_settings_service_settings,
	&foo2_settings_service_settings,
	NULL
};

diffstat:

 src/config/config-parser.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 1ee54bb2fa5a -r eee77416e137 src/config/config-parser.c
--- a/src/config/config-parser.c	Sat Jul 28 15:34:28 2012 +0300
+++ b/src/config/config-parser.c	Sat Jul 28 16:29:22 2012 +0300
@@ -997,10 +997,17 @@
 				array_append(&new_roots, &roots[i], 1);
 		}
 
-		service_set = module_get_symbol_quiet(m,
-			t_strdup_printf("%s_service_settings", m->name));
-		if (service_set != NULL)
-			array_append(&new_services, &service_set, 1);
+		services = module_get_symbol_quiet(m,
+			t_strdup_printf("%s_service_settings_array", m->name));
+		if (services != NULL) {
+			for (count = 0; services[count] != NULL; count++) ;
+			array_append(&new_services, services, count);
+		} else {
+			service_set = module_get_symbol_quiet(m,
+				t_strdup_printf("%s_service_settings", m->name));
+			if (service_set != NULL)
+				array_append(&new_services, &service_set, 1);
+		}
 	}
 	if (array_count(&new_roots) > 0) {
 		/* modules added new settings. add the defaults and start


More information about the dovecot-cvs mailing list