diff --git a/lwsws/main.c b/lwsws/main.c index 7b2b663bc..d62f6fe99 100644 --- a/lwsws/main.c +++ b/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 ] " - "[-d ] [--help]\n"); + "[-d ] [--help] " + "[-n]\n"); exit(1); } }