mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-23 16:20:26 -05:00
- Accept both option names with and without colon for get_option
and set_option. git-svn-id: file:///svn/unbound/trunk@4611 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
89ad258515
commit
fbee729c5b
2 changed files with 14 additions and 1 deletions
|
|
@ -4,6 +4,8 @@
|
||||||
- num.query.authzone.up and num.query.authzone.down statistics counters.
|
- num.query.authzone.up and num.query.authzone.down statistics counters.
|
||||||
- Fix downstream auth zone, only fallback when auth zone fails to
|
- Fix downstream auth zone, only fallback when auth zone fails to
|
||||||
answer and fallback is enabled.
|
answer and fallback is enabled.
|
||||||
|
- Accept both option names with and without colon for get_option
|
||||||
|
and set_option.
|
||||||
|
|
||||||
5 April 2018: Wouter
|
5 April 2018: Wouter
|
||||||
- Combine write of tcp length and tcp query for dns over tls.
|
- Combine write of tcp length and tcp query for dns over tls.
|
||||||
|
|
|
||||||
|
|
@ -386,6 +386,12 @@ struct config_file* config_create_forlib(void)
|
||||||
int config_set_option(struct config_file* cfg, const char* opt,
|
int config_set_option(struct config_file* cfg, const char* opt,
|
||||||
const char* val)
|
const char* val)
|
||||||
{
|
{
|
||||||
|
char buf[64];
|
||||||
|
if(!opt) return 0;
|
||||||
|
if(opt[strlen(opt)-1] != ':' && strlen(opt)+2<sizeof(buf)) {
|
||||||
|
snprintf(buf, sizeof(buf), "%s:", opt);
|
||||||
|
opt = buf;
|
||||||
|
}
|
||||||
S_NUMBER_OR_ZERO("verbosity:", verbosity)
|
S_NUMBER_OR_ZERO("verbosity:", verbosity)
|
||||||
else if(strcmp(opt, "statistics-interval:") == 0) {
|
else if(strcmp(opt, "statistics-interval:") == 0) {
|
||||||
if(strcmp(val, "0") == 0 || strcmp(val, "") == 0)
|
if(strcmp(val, "0") == 0 || strcmp(val, "") == 0)
|
||||||
|
|
@ -801,8 +807,13 @@ int
|
||||||
config_get_option(struct config_file* cfg, const char* opt,
|
config_get_option(struct config_file* cfg, const char* opt,
|
||||||
void (*func)(char*,void*), void* arg)
|
void (*func)(char*,void*), void* arg)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024], nopt[64];
|
||||||
size_t len = sizeof(buf);
|
size_t len = sizeof(buf);
|
||||||
|
if(opt && opt[strlen(opt)-1] == ':' && strlen(opt)<sizeof(nopt)) {
|
||||||
|
memmove(nopt, opt, strlen(opt));
|
||||||
|
nopt[strlen(opt)-1] = 0;
|
||||||
|
opt = nopt;
|
||||||
|
}
|
||||||
fptr_ok(fptr_whitelist_print_func(func));
|
fptr_ok(fptr_whitelist_print_func(func));
|
||||||
O_DEC(opt, "verbosity", verbosity)
|
O_DEC(opt, "verbosity", verbosity)
|
||||||
else O_DEC(opt, "statistics-interval", stat_interval)
|
else O_DEC(opt, "statistics-interval", stat_interval)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue