]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Remove unused master_service_settings_get_filters()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 29 Nov 2022 17:02:05 +0000 (19:02 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 13:01:47 +0000 (13:01 +0000)
src/lib-master/master-service-settings.c
src/lib-master/master-service-settings.h

index c4474d87fc9a3ecd3802dfdaf1fc2954602ff1d1..6571edace73598a236b9ec36857281e0238b3cfd 100644 (file)
@@ -407,18 +407,6 @@ config_send_request(struct master_service *service,
        return 0;
 }
 
-static int
-config_send_filters_request(int fd, const char *path, const char **error_r)
-{
-       int ret;
-       ret = write_full(fd, CONFIG_HANDSHAKE"FILTERS\n", strlen(CONFIG_HANDSHAKE"FILTERS\n"));
-       if (ret < 0) {
-               *error_r = t_strdup_printf("write_full(%s) failed: %m", path);
-               return -1;
-       }
-       return 0;
-}
-
 static int
 master_service_apply_config_overrides(struct master_service *service,
                                      struct setting_parser_context *parser,
@@ -514,54 +502,6 @@ void master_service_config_socket_try_open(struct master_service *service)
                service->config_fd = fd;
 }
 
-int master_service_settings_get_filters(struct master_service *service,
-                                       const char *const **filters,
-                                       const char **error_r)
-{
-       struct master_service_settings_input input;
-       int fd;
-       bool retry = TRUE;
-       const char *path = NULL;
-       ARRAY_TYPE(const_string) filters_tmp;
-       t_array_init(&filters_tmp, 8);
-       i_zero(&input);
-
-       if (getenv("DOVECONF_ENV") == NULL &&
-           (service->flags & MASTER_SERVICE_FLAG_NO_CONFIG_SETTINGS) == 0) {
-               retry = service->config_fd != -1;
-               for (;;) {
-                       fd = master_service_open_config(service, &input, &path, error_r);
-                       if (fd == -1) {
-                               return -1;
-                       }
-                       if (config_send_filters_request(fd, path, error_r) == 0)
-                               break;
-
-                       i_close_fd(&fd);
-                       if (!retry)
-                               return -1;
-                       retry = FALSE;
-               }
-               service->config_fd = fd;
-               struct istream *is = i_stream_create_fd(fd, SIZE_MAX);
-               const char *line;
-               /* try read response */
-               while((line = i_stream_read_next_line(is)) != NULL) {
-                       if (*line == '\0')
-                               break;
-                       if (str_begins(line, "FILTER\t", &line)) {
-                               line = t_strdup(line);
-                               array_push_back(&filters_tmp, &line);
-                       }
-               }
-               i_stream_unref(&is);
-       }
-
-       array_append_zero(&filters_tmp);
-       *filters = array_front(&filters_tmp);
-       return 0;
-}
-
 int master_service_settings_read(struct master_service *service,
                                 const struct master_service_settings_input *input,
                                 struct master_service_settings_output *output_r,
index f8678c8fd5fe33e0d7af769588286fa0c80e883c..58ff069c8eb8c88c17da2a09fa3c1ec2e8f7e813 100644 (file)
@@ -83,9 +83,6 @@ extern const struct setting_parser_info master_service_setting_parser_info;
 /* Try to open the config socket if it's going to be needed later by
    master_service_settings_read*() */
 void master_service_config_socket_try_open(struct master_service *service);
-int master_service_settings_get_filters(struct master_service *service,
-                                       const char *const **filters,
-                                       const char **error_r);
 int master_service_settings_read(struct master_service *service,
                                 const struct master_service_settings_input *input,
                                 struct master_service_settings_output *output_r,