mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
fix #2115
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user