summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-07 16:08:47 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-07 16:08:47 +0800
commit760f0a57d36fd3c2f30ba39f3db43fc41f8cb090 (patch)
tree53ac51d920a37ff4665138b2f1c243221f9e4e60
parentf6a55a03f850ccb3c3a16bfba4e77bc75147f844 (diff)
downloadpttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar.gz
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar.bz2
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar.lz
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar.xz
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.tar.zst
pttbbs-760f0a57d36fd3c2f30ba39f3db43fc41f8cb090.zip
dymaxactive, toomanyusers
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@778 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/pttstruct.h5
-rw-r--r--mbbsd/mbbsd.c7
-rw-r--r--util/shmctl.c4
3 files changed, 9 insertions, 7 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h
index 5ea7e799..2e3e5492 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -1,4 +1,4 @@
-/* $Id: pttstruct.h,v 1.32 2003/04/07 03:55:17 in2 Exp $ */
+/* $Id: pttstruct.h,v 1.33 2003/04/07 08:08:47 in2 Exp $ */
#ifndef INCLUDE_STRUCT_H
#define INCLUDE_STRUCT_H
@@ -353,7 +353,8 @@ typedef struct {
union {
int v[192];
struct {
- int dyactive;
+ int dymaxactive;
+ int toomanyusers;
} e;
} GV2;
char gap3_2[128];
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 97ba847a..6eade791 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.69 2003/03/28 14:15:20 in2 Exp $ */
+/* $Id: mbbsd.c,v 1.70 2003/04/07 08:08:47 in2 Exp $ */
#include "bbs.h"
#define SOCKET_QLEN 4
@@ -1342,10 +1342,11 @@ check_ban_and_load(int fd)
}
if (SHM->UTMPnumber >= MAX_ACTIVE
#ifdef DYMAX_ACTIVE
- || (GLOBALVAR[9] > 500 && SHM->UTMPnumber >= GLOBALVAR[9] )
+ || (SHM->GV2.e.dymaxactive > 2000 &&
+ SHM->UTMPnumber >= SHM->GV2.e.dymaxactive)
#endif
) {
- ++GLOBALVAR[8];
+ ++SHM->GV2.e.toomanyusers;
snprintf(buf, sizeof(buf), "由於人數過多,請您稍後再來。");
write(fd, buf, strlen(buf));
overload = 1;
diff --git a/util/shmctl.c b/util/shmctl.c
index 1417c2b0..2232c42d 100644
--- a/util/shmctl.c
+++ b/util/shmctl.c
@@ -1,4 +1,4 @@
-/* $Id: shmctl.c,v 1.36 2003/04/07 03:55:30 in2 Exp $ */
+/* $Id: shmctl.c,v 1.37 2003/04/07 08:08:47 in2 Exp $ */
#include "bbs.h"
#include <sys/wait.h>
@@ -337,7 +337,7 @@ int utmpnum(int argc, char **argv)
return 0;
}
-char *GV2str[] = {"dyactive", NULL};
+char *GV2str[] = {"dymaxactive", "toomanyusers", NULL};
int showglobal(int argc, char **argv)
{
int i;