From b2b25a5c967cfb01a70efc575f4bbd5f734e537a Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 11 Jun 2009 17:17:08 +0000 Subject: * allow client_code to be logged in tunnel mode git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4566 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index d7487370..ed4706b1 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -77,6 +77,15 @@ void UpdateClientCode(unsigned char c) { FNV1A_CHAR(c, client_code); } + +void LogClientCode() +{ + int fd = open("log/client_code",O_WRONLY | O_CREAT | O_APPEND, 0644); + if(fd>=0) { + write(fd, &client_code, sizeof(client_code)); + close(fd); + } +} #endif #ifdef USE_RFORK @@ -871,13 +880,7 @@ login_query(char *ruid) // auth ok. #ifdef DETECT_CLIENT - { - int fd = open("log/client_code",O_WRONLY | O_CREAT | O_APPEND, 0644); - if(fd>=0) { - write(fd, &client_code, sizeof(client_code)); - close(fd); - } - } + LogClientCode(); #endif } @@ -1963,16 +1966,20 @@ tunnel_login(char *argv0, struct ProgramOption *option) strlcpy(option->flag_user, dat.userid, sizeof(option->flag_user)); option->term_width = dat.t_cols; option->term_height = dat.t_lines; + #ifdef CONVERT if (dat.encoding) set_converting_type(dat.encoding); #endif telnet_init(0); + #ifdef DETECT_CLIENT telnet_turnoff_client_detect(); client_code = dat.client_code; // use the client code detected by remote daemon + LogClientCode(); #endif + return 1; } -- cgit v1.2.3