X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/3d88e64dfcf5dc0fd361ce0c504c67a9196ce44c..125105d16c788398562ac03e91ce7a0dc0292492:/telnet.c diff --git a/telnet.c b/telnet.c index 28d696d3..e3fff49f 100644 --- a/telnet.c +++ b/telnet.c @@ -955,6 +955,29 @@ static void telnet_special(void *handle, Telnet_Special code) } } +static const struct telnet_special *telnet_get_specials(void *handle) +{ + static const struct telnet_special specials[] = { + {"Are You There", TS_AYT}, + {"Break", TS_BRK}, + {"Synch", TS_SYNCH}, + {"Erase Character", TS_EC}, + {"Erase Line", TS_EL}, + {"Go Ahead", TS_GA}, + {"No Operation", TS_NOP}, + {"", 0}, + {"Abort Process", TS_ABORT}, + {"Abort Output", TS_AO}, + {"Interrupt Process", TS_IP}, + {"Suspend Process", TS_SUSP}, + {"", 0}, + {"End Of Record", TS_EOR}, + {"End Of File", TS_EOF}, + {NULL, 0} + }; + return specials; +} + static Socket telnet_socket(void *handle) { Telnet telnet = (Telnet) handle; @@ -996,9 +1019,12 @@ static void telnet_provide_logctx(void *handle, void *logctx) static int telnet_exitcode(void *handle) { - /* Telnet telnet = (Telnet) handle; */ - /* Telnet doesn't transmit exit codes back to the client */ - return 0; + Telnet telnet = (Telnet) handle; + if (telnet->s != NULL) + return -1; /* still connected */ + else + /* Telnet doesn't transmit exit codes back to the client */ + return 0; } Backend telnet_backend = { @@ -1009,6 +1035,7 @@ Backend telnet_backend = { telnet_sendbuffer, telnet_size, telnet_special, + telnet_get_specials, telnet_socket, telnet_exitcode, telnet_sendok,