Browse Source
Merge pull request #2268 from Mygod/master
Refine passing plugin args
pull/2269/head
Max Lv
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
10 additions and
7 deletions
-
src/local.c
-
src/plugin.c
-
src/redir.c
-
src/server.c
-
src/tunnel.c
|
|
@ -101,7 +101,7 @@ static crypto_t *crypto; |
|
|
|
static int acl = 0; |
|
|
|
static int mode = TCP_ONLY; |
|
|
|
static int ipv6first = 0; |
|
|
|
static int fast_open = 0; |
|
|
|
int fast_open = 0; |
|
|
|
static int no_delay = 0; |
|
|
|
static int udp_fd = 0; |
|
|
|
static int ret_val = 0; |
|
|
|
|
|
@ -109,10 +109,13 @@ start_ss_plugin(const char *plugin, |
|
|
|
if (plugin_opts != NULL) |
|
|
|
cork_env_add(env, "SS_PLUGIN_OPTIONS", plugin_opts); |
|
|
|
|
|
|
|
exec = cork_exec_new(plugin); |
|
|
|
cork_exec_add_param(exec, plugin); // argv[0] |
|
|
|
extern int fast_open; |
|
|
|
if (fast_open) cork_exec_add_param(exec, "--fast-open"); |
|
|
|
#ifdef __ANDROID__ |
|
|
|
exec = cork_exec_new_with_params("sh", "-c", plugin, NULL); |
|
|
|
#else |
|
|
|
exec = cork_exec_new_with_params(plugin, NULL); |
|
|
|
extern int vpn; |
|
|
|
if (vpn) cork_exec_add_param(exec, "-V"); |
|
|
|
#endif |
|
|
|
|
|
|
|
cork_exec_set_env(exec, env); |
|
|
|
|
|
@ -93,7 +93,7 @@ static int mode = TCP_ONLY; |
|
|
|
#ifdef HAVE_SETRLIMIT |
|
|
|
static int nofile = 0; |
|
|
|
#endif |
|
|
|
static int fast_open = 0; |
|
|
|
int fast_open = 0; |
|
|
|
static int no_delay = 0; |
|
|
|
static int ret_val = 0; |
|
|
|
|
|
|
|
|
|
@ -120,7 +120,7 @@ static crypto_t *crypto; |
|
|
|
static int acl = 0; |
|
|
|
static int mode = TCP_ONLY; |
|
|
|
static int ipv6first = 0; |
|
|
|
static int fast_open = 0; |
|
|
|
int fast_open = 0; |
|
|
|
static int no_delay = 0; |
|
|
|
static int ret_val = 0; |
|
|
|
|
|
|
|
|
|
@ -95,7 +95,7 @@ static int mode = TCP_ONLY; |
|
|
|
static int nofile = 0; |
|
|
|
#endif |
|
|
|
static int no_delay = 0; |
|
|
|
static int fast_open = 0; |
|
|
|
int fast_open = 0; |
|
|
|
static int ret_val = 0; |
|
|
|
|
|
|
|
static struct ev_signal sigint_watcher; |
|
|
|