X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8faa456cf83ade45a6a2f33784d46b9963a0f77e..edcbf00a807b86ea83cca4fa98e854790c4b4a04:/telnet.c diff --git a/telnet.c b/telnet.c index 3cef9c76..b00a6da0 100644 --- a/telnet.c +++ b/telnet.c @@ -587,7 +587,8 @@ static int telnet_receive(Plug plug, int urgent, char *data, int len) * * Returns an error message, or NULL on success. * - * Also places the canonical host name into `realhost'. + * Also places the canonical host name into `realhost'. It must be + * freed by the caller. */ static char *telnet_init(char *host, int port, char **realhost) { @@ -652,7 +653,9 @@ static void telnet_send(char *buf, int len) char *p; static unsigned char iac[2] = { IAC, IAC }; static unsigned char cr[2] = { CR, NUL }; +#if 0 static unsigned char nl[2] = { CR, LF }; +#endif if (s == NULL) return; @@ -666,7 +669,7 @@ static void telnet_send(char *buf, int len) sk_write(s, q, p - q); while (p < buf + len && !iswritable((unsigned char) *p)) { - sk_write(s, (unsigned char) *p == IAC ? iac : nl, 2); + sk_write(s, (unsigned char) *p == IAC ? iac : cr, 2); p++; } } @@ -758,6 +761,9 @@ static void telnet_special(Telnet_Special code) b[1] = xEOF; sk_write(s, b, 2); break; + case TS_EOL: + sk_write(s, "\r\n", 2); + break; case TS_SYNCH: b[1] = DM; sk_write(s, b, 1);