This commit is contained in:
Max Lv
2019-01-21 12:12:42 +08:00
parent 829b38420c
commit c33cf3efc0
7 changed files with 18 additions and 0 deletions
+1
View File
@@ -177,6 +177,7 @@ The config file equivalent of command line options is listed as example below.
| -m "aes-256-cfb" | "method": "aes-256-cfb"
| -t 60 | "timeout": 60
| -a nobody | "user": "nobody"
| --acl "/path/to/acl" | "acl": "/path/to/acl"
| --fast-open | "fast_open": true
| --reuse-port | "reuse_port": true
| --no-delay | "no_delay": true
+5
View File
@@ -164,6 +164,11 @@ trimwhitespace(char *str)
int
init_acl(const char *path)
{
if (path == NULL)
{
return -1;
}
// initialize ipset
ipset_init_library();
+2
View File
@@ -330,6 +330,8 @@ read_jconf(const char *file)
conf.no_delay = value->u.boolean;
} else if (strcmp(name, "workdir") == 0) {
conf.workdir = to_string(value);
} else if (strcmp(name, "acl") == 0) {
conf.acl = to_string(value);
}
}
} else {
+1
View File
@@ -86,6 +86,7 @@ typedef struct {
int ipv6_first;
int no_delay;
char *workdir;
char *acl;
} jconf_t;
jconf_t *read_jconf(const char *file);
+3
View File
@@ -1683,6 +1683,9 @@ main(int argc, char **argv)
if (ipv6first == 0) {
ipv6first = conf->ipv6_first;
}
if (acl == 0) {
acl = !init_acl(conf->acl);
}
}
if (remote_num == 0 || remote_port == NULL ||
+3
View File
@@ -1054,6 +1054,9 @@ main(int argc, char **argv)
{
workdir = conf->workdir;
}
if (acl == NULL) {
acl = conf->acl;
}
#ifdef HAVE_SETRLIMIT
if (nofile == 0) {
nofile = conf->nofile;
+3
View File
@@ -1817,6 +1817,9 @@ main(int argc, char **argv)
if (ipv6first == 0) {
ipv6first = conf->ipv6_first;
}
if (acl == 0) {
acl = !init_acl(conf->acl);
}
}
if (server_num == 0) {