mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-29 12:36:53 +00:00
add user config option
This commit is contained in:
@@ -197,6 +197,8 @@ read_jconf(const char *file)
|
||||
conf.method = to_string(value);
|
||||
} else if (strcmp(name, "timeout") == 0) {
|
||||
conf.timeout = to_string(value);
|
||||
} else if (strcmp(name, "user") == 0) {
|
||||
conf.user = to_string(value);
|
||||
} else if (strcmp(name, "fast_open") == 0) {
|
||||
check_json_value_type(value, json_boolean,
|
||||
"invalid config file: option 'fast_open' must be a boolean");
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef struct {
|
||||
char *password;
|
||||
char *method;
|
||||
char *timeout;
|
||||
char *user;
|
||||
int auth;
|
||||
int fast_open;
|
||||
int nofile;
|
||||
|
||||
@@ -1291,6 +1291,9 @@ main(int argc, char **argv)
|
||||
if (timeout == NULL) {
|
||||
timeout = conf->timeout;
|
||||
}
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
if (auth == 0) {
|
||||
auth = conf->auth;
|
||||
}
|
||||
|
||||
@@ -744,6 +744,9 @@ main(int argc, char **argv)
|
||||
if (timeout == NULL) {
|
||||
timeout = conf->timeout;
|
||||
}
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
#ifdef TCP_FASTOPEN
|
||||
if (fast_open == 0) {
|
||||
fast_open = conf->fast_open;
|
||||
|
||||
@@ -898,6 +898,9 @@ main(int argc, char **argv)
|
||||
if (timeout == NULL) {
|
||||
timeout = conf->timeout;
|
||||
}
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
if (auth == 0) {
|
||||
auth = conf->auth;
|
||||
}
|
||||
|
||||
@@ -1699,6 +1699,9 @@ main(int argc, char **argv)
|
||||
if (timeout == NULL) {
|
||||
timeout = conf->timeout;
|
||||
}
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
if (auth == 0) {
|
||||
auth = conf->auth;
|
||||
}
|
||||
|
||||
@@ -885,6 +885,9 @@ main(int argc, char **argv)
|
||||
if (timeout == NULL) {
|
||||
timeout = conf->timeout;
|
||||
}
|
||||
if (user == NULL) {
|
||||
user = conf->user;
|
||||
}
|
||||
if (auth == 0) {
|
||||
auth = conf->auth;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user