summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-01 18:04:41 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-01 18:04:41 +0800
commit566387a0641e4260ec5ed4f6592127d5e373668d (patch)
tree279f78b366667452fd88336f565ee84fedc74805 /mbbsd
parent03f93ae5b5773347501500802e828387971e5d15 (diff)
downloadpttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar.gz
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar.bz2
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar.lz
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar.xz
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.tar.zst
pttbbs-566387a0641e4260ec5ed4f6592127d5e373668d.zip
NOKILLWATERBALL,
do NOT kill(2) the process after sending a waterball, and check if there exists a waterball before read(2) from socket. this code is under testing and may have some bugs. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1441 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/io.c4
-rw-r--r--mbbsd/mbbsd.c7
-rw-r--r--mbbsd/talk.c8
-rw-r--r--mbbsd/var.c4
4 files changed, 21 insertions, 2 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 56bb4a78..a879f9e9 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -148,6 +148,10 @@ dogetch()
{
int len;
static time_t lastact;
+#ifdef NOKILLWATERBALL
+ if( currutmp && currutmp->msgcount && !reentrant_write_request )
+ write_request(1);
+#endif
if (ibufsize <= icurrchar) {
if (flushf)
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 044927dc..b64cab13 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -358,7 +358,9 @@ void
write_request(int sig)
{
int i;
-
+#ifdef NOKILLWATERBALL
+ reentrant_write_request = 1;
+#endif
if (WATERMODE(WATER_OFO)) {
/*
* sig = SIGUSR2 waterball come in 0 flush to water[] (by
@@ -427,6 +429,9 @@ write_request(int sig)
currutmp->msgcount = 0;
}
}
+#ifdef NOKILLWATERBALL
+ reentrant_write_request = 0;
+#endif
}
static void
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 2c3842d4..827ef274 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -667,7 +667,13 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin)
} else if (flag != 2)
outmsg("\033[1;33;41m糟糕! 對方不行了! (收到太多水球) \033[37m@_@\033[m");
- if (uin->msgcount >= 1 && (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1) && flag != 2)
+ if (uin->msgcount >= 1 &&
+#ifdef NOKILLWATERBALL
+ 0
+#else
+ (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1)
+#endif
+ && flag != 2)
outmsg("\033[1;33;41m糟糕! 沒打中! \033[37m~>_<~\033[m");
else if (uin->msgcount == 1 && flag != 2)
outmsg("\033[1;33;44m水球砸過去了! \033[37m*^o^*\033[m");
diff --git a/mbbsd/var.c b/mbbsd/var.c
index c58e8bb3..f2fb1500 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -621,6 +621,10 @@ char *friend_file[8] = {
FN_VISABLE
};
+#ifdef NOKILLWATERBALL
+char reentrant_write_request = 0;
+#endif
+
#ifdef PTTBBS_UTIL
#ifdef OUTTA_TIMER
#define COMMON_TIME (SHM->GV2.e.now)