diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-10-17 17:18:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 17:18:59 +0300 |
commit | ca4c305969e4fdfd2ceea3b8b93c32ad74ebf66d (patch) | |
tree | 7895ed67c0453de6635ab1f8faf98923da813576 /libnetdata/socket | |
parent | ad3ff17ac19546d24812daa6f0eca62301e296fa (diff) |
moved stream.conf initialization after log files have been open; fixes #4403 (#4422)
Diffstat (limited to 'libnetdata/socket')
-rw-r--r-- | libnetdata/socket/socket.c | 8 | ||||
-rw-r--r-- | libnetdata/socket/socket.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libnetdata/socket/socket.c b/libnetdata/socket/socket.c index 5e65d907a0..94a39ebca1 100644 --- a/libnetdata/socket/socket.c +++ b/libnetdata/socket/socket.c @@ -448,19 +448,19 @@ static inline int bind_to_this(LISTEN_SOCKETS *sockets, const char *definition, int listen_sockets_setup(LISTEN_SOCKETS *sockets) { listen_sockets_init(sockets); - sockets->backlog = (int) config_get_number(sockets->config_section, "listen backlog", sockets->backlog); + sockets->backlog = (int) appconfig_get_number(sockets->config, sockets->config_section, "listen backlog", sockets->backlog); long long int old_port = sockets->default_port; - long long int new_port = config_get_number(sockets->config_section, "default port", sockets->default_port); + long long int new_port = appconfig_get_number(sockets->config, sockets->config_section, "default port", sockets->default_port); if(new_port < 1 || new_port > 65535) { error("LISTENER: Invalid listen port %lld given. Defaulting to %lld.", new_port, old_port); - sockets->default_port = (uint16_t) config_set_number(sockets->config_section, "default port", old_port); + sockets->default_port = (uint16_t) appconfig_set_number(sockets->config, sockets->config_section, "default port", old_port); } else sockets->default_port = (uint16_t)new_port; debug(D_OPTIONS, "LISTENER: Default listen port set to %d.", sockets->default_port); - char *s = config_get(sockets->config_section, "bind to", sockets->default_bind_to); + char *s = appconfig_get(sockets->config, sockets->config_section, "bind to", sockets->default_bind_to); while(*s) { char *e = s; diff --git a/libnetdata/socket/socket.h b/libnetdata/socket/socket.h index 8594174ec9..f5412b63df 100644 --- a/libnetdata/socket/socket.h +++ b/libnetdata/socket/socket.h @@ -10,6 +10,7 @@ #endif typedef struct listen_sockets { + struct config *config; // the config file to use const char *config_section; // the netdata configuration section to read settings from const char *default_bind_to; // the default bind to configuration string uint16_t default_port; // the default port to use |