X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fconfig.c;h=978e20693b1b4c51c76395339422666791239445;hb=9c210ba0b55c056e6dd77c05ab57e57257aee36f;hp=3b81fec3f1fcb67fbf64ba28ac1759a722a9c2da;hpb=ab546f749bee4d48ff258c342eaabcacc6ec7c4d;p=citadel.git diff --git a/citadel/config.c b/citadel/config.c index 3b81fec3f..978e20693 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -79,14 +79,16 @@ void get_config(void) { if (config.c_maxmsglen < 8192) config.c_maxmsglen = 8192; - /* Default number of worker threads is 15 and the minimum is 5 - */ - /* Can't have fewer than two worker threads */ - if (config.c_worker_threads == 0) - config.c_worker_threads = 15; - if (config.c_worker_threads < 5) - config.c_worker_threads = 5; - + /* Default lower and upper limits on number of worker threads */ + + if (config.c_min_workers < 3) /* no less than 3 */ + config.c_min_workers = 5; + + if (config.c_max_workers == 0) /* default maximum */ + config.c_max_workers = 256; + + if (config.c_max_workers < config.c_min_workers) /* max >= min */ + config.c_max_workers = config.c_min_workers; }