diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-26 01:21:08 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-05-26 01:21:08 +0800 |
commit | 90e35e137daa94c9b448c5a8b243a2f434e557d6 (patch) | |
tree | 5e5e4cf2e353a593acddb314d86aaa05a34d3970 /mbbsd | |
parent | d140efb06f995fb018eeda430ce410964c462aa5 (diff) | |
download | pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar.gz pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar.bz2 pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar.lz pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar.xz pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.tar.zst pttbbs-90e35e137daa94c9b448c5a8b243a2f434e557d6.zip |
- revise flag_checkload. it should not bypass out of service.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4485 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mbbsd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 7218228f..1e9a9ea7 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1456,7 +1456,7 @@ bind_port(int port) static int shell_login(char *argv0, struct ProgramOption *option); static int daemon_login(char *argv0, struct ProgramOption *option); -static int check_ban_and_load(int fd); +static int check_ban_and_load(int fd, struct ProgramOption *option); static int check_banip(char *host); static void init(void) @@ -1684,11 +1684,9 @@ shell_login(char *argv0, struct ProgramOption *option) } init_tty(); - if (option->flag_checkload) { - if (check_ban_and_load(0)) { - sleep(10); - return 0; - } + if (check_ban_and_load(0, option)) { + sleep(10); + return 0; } #ifdef DETECT_CLIENT FNV1A_CHAR(123, client_code); @@ -1773,7 +1771,7 @@ daemon_login(char *argv0, struct ProgramOption *option) continue; } - overloading = check_ban_and_load(csock); + overloading = check_ban_and_load(csock, option); #if OVERLOADBLOCKFDS if( (!overloading && nblocked) || (overloading && nblocked == OVERLOADBLOCKFDS) ){ @@ -1828,7 +1826,7 @@ daemon_login(char *argv0, struct ProgramOption *option) * permitted, return 0; else return -1; approriate message is output to fd. */ static int -check_ban_and_load(int fd) +check_ban_and_load(int fd, struct ProgramOption *option) { FILE *fp; static time4_t chkload_time = 0; @@ -1864,6 +1862,9 @@ check_ban_and_load(int fd) chkload_time = time(0); } + if (!option->flag_checkload) + overload = 0; + if(overload == 1) write(fd, "系統過載, 請稍後再來\r\n", 22); else if(overload == 2) |