diff --git a/README b/README index fd217a2..4cf91c7 100644 --- a/README +++ b/README @@ -78,14 +78,6 @@ IIa. Initialization LIBTELNET_FLAG_PROXY Operate in proxy mode. This disables the RFC1143 support and enables automatic detection of COMPRESS2 streams. - - LIBTELNET_FLAG_AUTO_CRLF - Automatically translate C newlines (\n) into the TELNET - newline marker, CRLF (\r\n). This also translates the C - carriage return (\r) into the TELNET-correct CRNUL (\r\0). - - Note that this only affects data that is sent. Received - data is untranslated, even with this flag set. boid libtelnet_free(libtelnet_t *telnet); Releases any internal memory allocated by libtelnet. This must diff --git a/libtelnet.c b/libtelnet.c index 9688d24..97055e6 100644 --- a/libtelnet.c +++ b/libtelnet.c @@ -794,8 +794,6 @@ void libtelnet_send_negotiate(libtelnet_t *telnet, unsigned char cmd, /* send non-command data (escapes IAC bytes) */ void libtelnet_send_data(libtelnet_t *telnet, const unsigned char *buffer, unsigned int size) { - static const unsigned char CRLF[] = { '\r', '\n' }; - static const unsigned char CRNUL[] = { '\r', '\0' }; unsigned int i, l; for (l = i = 0; i != size; ++i) { @@ -808,20 +806,6 @@ void libtelnet_send_data(libtelnet_t *telnet, const unsigned char *buffer, /* send escape */ libtelnet_send_command(telnet, LIBTELNET_IAC); - - /* automatic translation of \n -> CRLF and \r -> CRNUL */ - } else if (telnet->flags & LIBTELNET_FLAG_AUTO_CRLF && - (buffer[i] == '\r' || buffer[i] == '\n')) { - /* dump prior text if any */ - if (i != l) - _send(telnet, buffer + l, i - l); - l = i + 1; - - /* translate */ - if (buffer[i] == '\r') - _send(telnet, CRNUL, 2); - else - _send(telnet, CRLF, 2); } } diff --git a/libtelnet.h b/libtelnet.h index a8bf4da..f03b92f 100644 --- a/libtelnet.h +++ b/libtelnet.h @@ -92,7 +92,6 @@ typedef enum libtelnet_event_type_t libtelnet_event_type_t; /* libtelnet feature flags */ #define LIBTELNET_FLAG_PROXY (1<<0) -#define LIBTELNET_FLAG_AUTO_CRLF (1<<1) #define LIBTELNET_PFLAG_DEFLATE (1<<7)