From: Timo Sirainen Date: Tue, 25 Jan 2022 10:18:30 +0000 (+0100) Subject: master: Split off service_is_enabled() X-Git-Tag: 2.4.0~4555 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a6121e81c0e5853e671a0158a2d265ca275adbb;p=thirdparty%2Fdovecot%2Fcore.git master: Split off service_is_enabled() --- diff --git a/src/master/master-settings.c b/src/master/master-settings.c index 7cfaa35a30..283ff90510 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -408,6 +408,14 @@ service_get_client_limit(struct master_settings *set, const char *name) return set->default_client_limit; } +static bool service_is_enabled(const struct master_settings *set, + struct service_settings *service) +{ + return service->protocol[0] == '\0' || + str_array_find((const char **)set->protocols_split, + service->protocol); +} + static bool master_settings_verify(void *_set, pool_t pool, const char **error_r) { @@ -513,9 +521,7 @@ master_settings_verify(void *_set, pool_t pool, const char **error_r) for (i = 0; i < count; i++) { struct service_settings *service = services[i]; - if (*service->protocol != '\0' && - !str_array_find((const char **)set->protocols_split, - service->protocol)) { + if (!service_is_enabled(set, service)) { /* protocol not enabled, ignore its settings */ continue; }