This commit is contained in:
Cloud Wu
2025-12-16 08:34:36 +08:00
parent 7c1f979959
commit 28e8087029

View File

@@ -13,6 +13,10 @@
#include <signal.h> #include <signal.h>
#include <assert.h> #include <assert.h>
#ifndef SKYNET_MAXTHREAD
#define SKYNET_MAXTHREAD 1024
#endif
static int static int
optint(const char *key, int opt) { optint(const char *key, int opt) {
const char * str = skynet_getenv(key); const char * str = skynet_getenv(key);
@@ -154,6 +158,10 @@ main(int argc, char *argv[]) {
lua_close(L); lua_close(L);
config.thread = optint("thread",8); config.thread = optint("thread",8);
if (config.thread < 1 || config.thread > SKYNET_MAXTHREAD) {
fprintf(stderr, "Invalid thread %d , should be in [1,%d]\n", config.thread, SKYNET_MAXTHREAD);
return 1;
}
config.module_path = optstring("cpath","./cservice/?.so"); config.module_path = optstring("cpath","./cservice/?.so");
config.harbor = optint("harbor", 1); config.harbor = optint("harbor", 1);
config.bootstrap = optstring("bootstrap","snlua bootstrap"); config.bootstrap = optstring("bootstrap","snlua bootstrap");