diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-09 12:42:53 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-09 12:42:53 +0800 |
commit | 40fafbfba1a53581e9318c71d6366a24470173be (patch) | |
tree | 065380a6e4881de9c51609773d048f165b8fc988 /mbbsd/talk.c | |
parent | fc5bd5742759eea401ffa112d696a3fe028675d1 (diff) | |
download | pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar.gz pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar.bz2 pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar.lz pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar.xz pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.tar.zst pttbbs-40fafbfba1a53581e9318c71d6366a24470173be.zip |
fix chc bug, but still buggy
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2184 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r-- | mbbsd/talk.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index e96ed86e..eb51d4f4 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2697,10 +2697,7 @@ t_talk() int reply_connection_request(userinfo_t *uip) { - int a; char buf[4], genbuf[200]; - struct hostent *h; - struct sockaddr_in sin; if (uip->mode != PAGE) { snprintf(genbuf, sizeof(genbuf), @@ -2708,6 +2705,16 @@ reply_connection_request(userinfo_t *uip) getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO); return -1; } + return establish_talk_connection(uip); +} + +int +establish_talk_connection(userinfo_t *uip) +{ + int a; + struct hostent *h; + struct sockaddr_in sin; + currutmp->msgcount = 0; strlcpy(save_page_requestor, page_requestor, sizeof(save_page_requestor)); memset(page_requestor, 0, sizeof(page_requestor)); @@ -2719,7 +2726,10 @@ reply_connection_request(userinfo_t *uip) sin.sin_family = h->h_addrtype; memcpy(&sin.sin_addr, h->h_addr, h->h_length); sin.sin_port = uip->sockaddr; - a = socket(sin.sin_family, SOCK_STREAM, 0); + if ((a = socket(sin.sin_family, SOCK_STREAM, 0)) < 0) { + perror("connect err"); + return -1; + } if ((connect(a, (struct sockaddr *) & sin, sizeof(sin)))) { perror("connect err"); return -1; @@ -2980,14 +2990,14 @@ AngelNotOnline(){ outs("\nÍ¢¯d¨¥µ¹§A¡G\n"); outs("\033[1;31;44m¡ó¢s¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢t\033[37m" "¤p¤Ñ¨Ï¯d¨¥\033[31m¢u¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢s¡ó\033[m\n"); - outs("\033[1;31mùú¢t\033[32m ¤p¤Ñ¨Ï " - " \033[31m¢uùû\033[m\n"); + outs("\033[1;31m¢~¢t\033[32m ¤p¤Ñ¨Ï " + " \033[31m¢u¢¡\033[m\n"); while (fgets(buf, sizeof(buf), fp)) { buf[strlen(buf) - 1] = 0; prints("\033[1;31m¢x\033[m%-74.74s\033[1;31m¢x\033[m\n", buf); } - outs("\033[1;31mùü¢s¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w" - "¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢sùý\033[m\n"); + outs("\033[1;31m¢¢¢s¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w" + "¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢s¢£\033[m\n"); outs("\033[1;31;44m¡ó¢r¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w" "¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢r¡ó\033[m\n"); |