diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 01:17:08 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 01:17:08 +0800 |
commit | b2b25a5c967cfb01a70efc575f4bbd5f734e537a (patch) | |
tree | 405cf963cb8e76aeee3d4e8124e0c0050737bba0 | |
parent | 8038b729288b224ea51525d0439282b776de58f6 (diff) | |
download | pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar.gz pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar.bz2 pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar.lz pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar.xz pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.tar.zst pttbbs-b2b25a5c967cfb01a70efc575f4bbd5f734e537a.zip |
* 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
-rw-r--r-- | mbbsd/mbbsd.c | 21 |
1 files changed, 14 insertions, 7 deletions
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; } |