Browse Source

Fix #2267

pull/2274/head
Max Lv 6 years ago
parent
commit
c33cf3efc0
7 changed files with 18 additions and 0 deletions
  1. 1
      doc/shadowsocks-libev.asciidoc
  2. 5
      src/acl.c
  3. 2
      src/jconf.c
  4. 1
      src/jconf.h
  5. 3
      src/local.c
  6. 3
      src/manager.c
  7. 3
      src/server.c

1
doc/shadowsocks-libev.asciidoc

@ -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
src/acl.c

@ -164,6 +164,11 @@ trimwhitespace(char *str)
int
init_acl(const char *path)
{
if (path == NULL)
{
return -1;
}
// initialize ipset
ipset_init_library();

2
src/jconf.c

@ -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
src/jconf.h

@ -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
src/local.c

@ -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
src/manager.c

@ -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
src/server.c

@ -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) {

Loading…
Cancel
Save