Merge pull request #2268 from Mygod/master

Refine passing plugin args
This commit is contained in:
Max Lv
2019-01-17 08:03:51 +08:00
committed by GitHub
5 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -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;
+6 -3
View File
@@ -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);
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;