From: Florian Forster Date: Tue, 2 May 2017 08:52:58 +0000 (+0200) Subject: libcollectdclient: Add lcc_network_parse_options_t to lcc_listener_t. X-Git-Tag: collectd-5.8.0~102^2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1cee13d802444f4062a373192e83ba92608d7f3b;p=collectd.git libcollectdclient: Add lcc_network_parse_options_t to lcc_listener_t. This avoids listing the same fields twice. --- diff --git a/src/libcollectdclient/collectd/server.h b/src/libcollectdclient/collectd/server.h index 48b58744..d1902173 100644 --- a/src/libcollectdclient/collectd/server.h +++ b/src/libcollectdclient/collectd/server.h @@ -59,18 +59,12 @@ typedef struct { * lcc_network_parse() if set to NULL. */ lcc_network_parser_t parser; - /* writer is the callback used to send incoming lcc_value_list_t to. */ - lcc_value_list_writer_t writer; + /* parse_options contains options for parser and is passed on verbatimely. */ + lcc_network_parse_options_t parse_options; /* buffer_size determines the maximum packet size to accept. */ uint16_t buffer_size; - /* password_lookup is used to look up the password for a given username. */ - lcc_password_lookup_t password_lookup; - - /* security_level is the minimal required security level. */ - lcc_security_level_t security_level; - /* interface is the name of the interface to use when subscribing to a * multicast group. Has no effect when using unicast. */ char *interface; diff --git a/src/libcollectdclient/server.c b/src/libcollectdclient/server.c index 68e4a9ea..1c4a1013 100644 --- a/src/libcollectdclient/server.c +++ b/src/libcollectdclient/server.c @@ -203,12 +203,7 @@ int lcc_listen_and_write(lcc_listener_t srv) { break; } - (void)srv.parser(buffer, (size_t)len, - (lcc_network_parse_options_t){ - .writer = srv.writer, - .password_lookup = srv.password_lookup, - .security_level = srv.security_level, - }); + (void)srv.parser(buffer, (size_t)len, srv.parse_options); } if (close_socket) {