mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
lwsws: add -n to allow skipping lws plugins dir
This commit is contained in:
parent
c2271b4ec6
commit
942f46b7d4
1 changed files with 11 additions and 5 deletions
16
lwsws/main.c
16
lwsws/main.c
|
@ -57,7 +57,7 @@ int fork(void)
|
|||
|
||||
static struct lws_context *context;
|
||||
static lws_sorted_usec_list_t sul_lwsws;
|
||||
static char config_dir[128];
|
||||
static char config_dir[128], default_plugin_path = 1;
|
||||
static int opts = 0, do_reload = 1;
|
||||
static uv_loop_t loop;
|
||||
static uv_signal_t signal_outer[2];
|
||||
|
@ -89,6 +89,7 @@ static struct option options[] = {
|
|||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "debug", required_argument, NULL, 'd' },
|
||||
{ "configdir", required_argument, NULL, 'c' },
|
||||
{ "no-default-plugins", no_argument, NULL, 'n' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
@ -153,7 +154,8 @@ context_creation(void)
|
|||
LWS_SERVER_OPTION_LIBUV;
|
||||
|
||||
#if defined(LWS_WITH_PLUGINS)
|
||||
info.plugin_dirs = plugin_dirs;
|
||||
if (default_plugin_path)
|
||||
info.plugin_dirs = plugin_dirs;
|
||||
#endif
|
||||
lwsl_notice("Using config dir: \"%s\"\n", config_dir);
|
||||
|
||||
|
@ -244,9 +246,9 @@ int main(int argc, char **argv)
|
|||
strcpy(config_dir, "/etc/lwsws");
|
||||
while (n >= 0) {
|
||||
#if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)
|
||||
n = getopt_long(argc, argv, "hd:c:", options, NULL);
|
||||
n = getopt_long(argc, argv, "hd:c:n", options, NULL);
|
||||
#else
|
||||
n = getopt(argc, argv, "hd:c:");
|
||||
n = getopt(argc, argv, "hd:c:n");
|
||||
#endif
|
||||
if (n < 0)
|
||||
continue;
|
||||
|
@ -254,12 +256,16 @@ int main(int argc, char **argv)
|
|||
case 'd':
|
||||
debug_level = atoi(optarg);
|
||||
break;
|
||||
case 'n':
|
||||
default_plugin_path = 0;
|
||||
break;
|
||||
case 'c':
|
||||
lws_strncpy(config_dir, optarg, sizeof(config_dir));
|
||||
break;
|
||||
case 'h':
|
||||
fprintf(stderr, "Usage: lwsws [-c <config dir>] "
|
||||
"[-d <log bitfield>] [--help]\n");
|
||||
"[-d <log bitfield>] [--help] "
|
||||
"[-n]\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue