aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-12-19 11:30:13 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-12-19 11:30:13 +0000
commit5ae5927d26427118c333f2615f79e386d89988e1 (patch)
tree454c30aa3f9f83ca4ec139a787e3ed5322bba247
parent877f4ea4398d340d8655e6583f95535a52f4c8b7 (diff)
downloadbusybox-w32-5ae5927d26427118c333f2615f79e386d89988e1.tar.gz
busybox-w32-5ae5927d26427118c333f2615f79e386d89988e1.tar.bz2
busybox-w32-5ae5927d26427118c333f2615f79e386d89988e1.zip
Patch from Fillod Stephane:
* While I'm at it, there's also a "telnetd.patch" which maps CRLF to CR, like netkit-telnet does, required by the loosy Windows telnet clients. git-svn-id: svn://busybox.net/trunk/busybox@8128 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/telnetd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 9a60a9a3c..3d5e8d100 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -1,4 +1,4 @@
1/* $Id: telnetd.c,v 1.8 2003/09/12 11:27:15 bug1 Exp $ 1/* $Id: telnetd.c,v 1.9 2003/12/19 11:30:13 andersen Exp $
2 * 2 *
3 * Simple telnet server 3 * Simple telnet server
4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) 4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com)
@@ -116,6 +116,8 @@ static struct tsession *sessions;
116 FIXME - if we mean to send 0xFF to the terminal then it will be escaped, 116 FIXME - if we mean to send 0xFF to the terminal then it will be escaped,
117 what is the escape character? We aren't handling that situation here. 117 what is the escape character? We aren't handling that situation here.
118 118
119 CR-LF ->'s CR mapping is also done here, for convenience
120
119 */ 121 */
120static char * 122static char *
121remove_iacs(struct tsession *ts, int *pnum_totty) { 123remove_iacs(struct tsession *ts, int *pnum_totty) {
@@ -128,7 +130,14 @@ remove_iacs(struct tsession *ts, int *pnum_totty) {
128 130
129 while (ptr < end) { 131 while (ptr < end) {
130 if (*ptr != IAC) { 132 if (*ptr != IAC) {
133 int c = *ptr;
131 *totty++ = *ptr++; 134 *totty++ = *ptr++;
135 /* We now map \r\n ==> \r for pragmatic reasons.
136 * Many client implementations send \r\n when
137 * the user hits the CarriageReturn key.
138 */
139 if (c == '\r' && (*ptr == '\n' || *ptr == 0) && ptr < end)
140 ptr++;
132 } 141 }
133 else { 142 else {
134 if ((ptr+2) < end) { 143 if ((ptr+2) < end) {