summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-09 16:09:29 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-09 16:09:29 +0800
commit86f83316beabe3496e7cf4ec2718a23ce5e5cb2f (patch)
treee5f2ebf67fc21135d94a7578c1c6578dd2ea206b
parent61dabcb2c84dce8c3ec6a306848f1f53b1c2cdf5 (diff)
downloadpttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.gz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.bz2
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.lz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.xz
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.tar.zst
pttbbs-86f83316beabe3496e7cf4ec2718a23ce5e5cb2f.zip
Use fromd for 故鄉
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4110 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/mbbsd.c15
-rw-r--r--sample/pttbbs.conf5
2 files changed, 20 insertions, 0 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index bdcbd0a3..b112b821 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -959,7 +959,22 @@ setup_utmp(int mode)
//strlcpy(uinfo.realname, cuser.realname, sizeof(uinfo.realname));
strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname));
strip_nonebig5((unsigned char *)uinfo.nickname, sizeof(uinfo.nickname));
+#ifdef FROMD
+ {
+ int fd;
+ if ( (fd = toconnect(FROMD_HOST, FROMD_PORT)) >= 0 ) {
+ write(fd, fromhost, strlen(fromhost));
+ // uinfo.from is zerod, so we don't care about read length
+ read(fd, uinfo.from, sizeof(uinfo.from));
+ close(fd);
+ }
+ else {
+ strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+ }
+ }
+#else
strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+#endif
uinfo.five_win = cuser.five_win;
uinfo.five_lose = cuser.five_lose;
uinfo.five_tie = cuser.five_tie;
diff --git a/sample/pttbbs.conf b/sample/pttbbs.conf
index f19f99db..7dc51b56 100644
--- a/sample/pttbbs.conf
+++ b/sample/pttbbs.conf
@@ -273,6 +273,11 @@
/* ¦b cacheserver ¤W­±¾×±¼¨g¤W¤U¯¸ªº¨Ï¥ÎªÌ */
//#define NOFLOODING
+/* ¨Ï¥Î fromd, ¨Ï¥Î¥~³¡daemon¬ö¿ý¤W¯¸¬G¶m¦WºÙ */
+//#define FROMD
+//#define FROMD_HOST "127.0.0.1"
+//#define FROMD_PORT "5130"
+
/* ­Y©w¸q, «h¤£¤¹³\µù¥U guest */
//#define NO_GUEST_ACCOUNT_REG