diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 21:12:14 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-12 21:12:14 +0800 |
commit | 91e59579ba3a660beb77daf5b499a0c669daf682 (patch) | |
tree | e6ee68193a45455afa918addd7ebee8cb44acf21 /daemon/logind | |
parent | 9a9b4ad3b178f120919b248c77e9a0ac489caf1c (diff) | |
download | pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar.gz pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar.bz2 pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar.lz pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar.xz pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.tar.zst pttbbs-91e59579ba3a660beb77daf5b499a0c669daf682.zip |
* ultilize AYT in logind
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4576 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'daemon/logind')
-rw-r--r-- | daemon/logind/logind.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c index 4c30a49d..bf338703 100644 --- a/daemon/logind/logind.c +++ b/daemon/logind/logind.c @@ -448,15 +448,37 @@ _telnet_write_data_cb(void *write_arg, int fd, const void *buf, size_t nbytes) _buff_write(conn, buf, nbytes); } +#define REPORT_OPENFD_IN_AYT + +#ifdef REPORT_OPENFD_IN_AYT +static void +_telnet_send_ayt_cb(void *ayt_arg, int fd) +{ + login_conn_ctx *conn = (login_conn_ctx *)ayt_arg; + char buf[32]; + + assert(conn); + snprintf(buf, sizeof(buf), " %u \r\n", g_opened_fd); + _buff_write(conn, buf, strlen(buf)); +} +#endif + const static struct TelnetCallback telnet_callback = { _telnet_write_data_cb, _telnet_resize_term_cb, + #ifdef DETECT_CLIENT _telnet_update_cc_cb, #else NULL, #endif + +#ifdef REPORT_OPENFD_IN_AYT + _telnet_send_ayt_cb, +#else + NULL, +#endif }; /////////////////////////////////////////////////////////////////////// @@ -1162,6 +1184,9 @@ listen_cb(int lfd, short event, void *arg) #ifdef DETECT_CLIENT telnet_ctx_set_cc_arg(&conn->telnet, (void*) &conn->ctx); #endif +#ifdef REPORT_OPENFD_IN_AYT + telnet_ctx_set_ayt_arg(&conn->telnet, (void*) conn); // use conn for buffered events +#endif // better send after all parameters were set telnet_ctx_send_init_cmds(&conn->telnet); |