Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
dovecot22
0003-config-Add-command-to-request-all-filters....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-config-Add-command-to-request-all-filters.patch of Package dovecot22
From 02da33a59fddd51cc3b8d95989de95574b7332f1 Mon Sep 17 00:00:00 2001 From: Aki Tuomi <aki.tuomi@dovecot.fi> Date: Thu, 30 Nov 2017 15:46:52 +0200 Subject: [PATCH 3/6] config: Add command to request all filters --- src/config/config-connection.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/config/config-connection.c b/src/config/config-connection.c index e617229..2885e05 100644 --- a/src/config/config-connection.c +++ b/src/config/config-connection.c @@ -150,6 +150,36 @@ static int config_connection_request(struct config_connection *conn, return 0; } +static int config_filters_request(struct config_connection *conn) +{ + struct config_filter_parser *const *filters = config_filter_get_all(config_filter); + o_stream_cork(conn->output); + while(*filters != NULL) { + const struct config_filter *filter = &(*filters)->filter; + o_stream_nsend_str(conn->output, "FILTER"); + if (filter->service != NULL) + o_stream_nsend_str(conn->output, t_strdup_printf("\tservice=%s", + filter->service)); + if (filter->local_name != NULL) + o_stream_nsend_str(conn->output, t_strdup_printf("\tlocal-name=%s", + filter->local_name)); + if (filter->local_bits > 0) + o_stream_nsend_str(conn->output, t_strdup_printf("\tlocal-net=%s/%u", + net_ip2addr(&filter->local_net), + filter->local_bits)); + if (filter->remote_bits > 0) + o_stream_nsend_str(conn->output, t_strdup_printf("\tremote-net=%s/%u", + net_ip2addr(&filter->remote_net), + filter->remote_bits)); + o_stream_nsend_str(conn->output, "\n"); + filters++; + } + o_stream_nsend_str(conn->output, "\n"); + o_stream_uncork(conn->output); + return 0; +} + + static void config_connection_input(struct config_connection *conn) { const char *const *args, *line; @@ -186,6 +216,10 @@ static void config_connection_input(struct config_connection *conn) if (config_connection_request(conn, args + 1) < 0) break; } + if (strcmp(args[0], "FILTERS") == 0) { + if (config_filters_request(conn) < 0) + break; + } } } -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor