|
|
@ -213,7 +213,8 @@ int opt_statsavg = 30; |
|
|
|
|
|
|
|
|
|
|
|
// strdup on char* to allow a common free() if used
|
|
|
|
// strdup on char* to allow a common free() if used
|
|
|
|
static char* opt_syslog_pfx = strdup(PROGRAM_NAME); |
|
|
|
static char* opt_syslog_pfx = strdup(PROGRAM_NAME); |
|
|
|
char *opt_api_allow = strdup("127.0.0.1"); /* 0.0.0.0 for all ips */ |
|
|
|
char *opt_api_bind = strdup("127.0.0.1"); /* 0.0.0.0 for all ips */ |
|
|
|
|
|
|
|
char *opt_api_allow = NULL; /* unimplemented */ |
|
|
|
int opt_api_remote = 0; |
|
|
|
int opt_api_remote = 0; |
|
|
|
int opt_api_listen = 4068; /* 0 to disable */ |
|
|
|
int opt_api_listen = 4068; /* 0 to disable */ |
|
|
|
|
|
|
|
|
|
|
@ -576,7 +577,7 @@ void proper_exit(int reason) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
free(opt_syslog_pfx); |
|
|
|
free(opt_syslog_pfx); |
|
|
|
free(opt_api_allow); |
|
|
|
free(opt_api_bind); |
|
|
|
//free(work_restart);
|
|
|
|
//free(work_restart);
|
|
|
|
//free(thr_info);
|
|
|
|
//free(thr_info);
|
|
|
|
exit(reason); |
|
|
|
exit(reason); |
|
|
@ -2972,16 +2973,16 @@ void parse_arg(int key, char *arg) |
|
|
|
if (p) { |
|
|
|
if (p) { |
|
|
|
/* ip:port */ |
|
|
|
/* ip:port */ |
|
|
|
if (p - arg > 0) { |
|
|
|
if (p - arg > 0) { |
|
|
|
free(opt_api_allow); |
|
|
|
free(opt_api_bind); |
|
|
|
opt_api_allow = strdup(arg); |
|
|
|
opt_api_bind = strdup(arg); |
|
|
|
opt_api_allow[p - arg] = '\0'; |
|
|
|
opt_api_bind[p - arg] = '\0'; |
|
|
|
} |
|
|
|
} |
|
|
|
opt_api_listen = atoi(p + 1); |
|
|
|
opt_api_listen = atoi(p + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (arg && strstr(arg, ".")) { |
|
|
|
else if (arg && strstr(arg, ".")) { |
|
|
|
/* ip only */ |
|
|
|
/* ip only */ |
|
|
|
free(opt_api_allow); |
|
|
|
free(opt_api_bind); |
|
|
|
opt_api_allow = strdup(arg); |
|
|
|
opt_api_bind = strdup(arg); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (arg) { |
|
|
|
else if (arg) { |
|
|
|
/* port or 0 to disable */ |
|
|
|
/* port or 0 to disable */ |
|
|
|