Telnet and carriage return.
Denys Vlasenko
vda.linux at googlemail.com
Thu Sep 13 13:36:58 UTC 2012
On Thu, Sep 13, 2012 at 2:55 PM, Ralf Friedl <Ralf.Friedl at online.de> wrote:
> Denys Vlasenko wrote:
>>
>> Changed it to this in git:
>>
>> else if (c == '\r')
>> - outbuf[j++] = '\0'; /* CR -> CR NUL */
>> + /* See RFC 1123 3.3.1 Telnet End-of-Line
>> Convention.
>> + * Using CR LF instead of other allowed
>> possibilities
>> + * like CR NUL - easier to talk to HTTP/SMTP
>> servers.
>> + */
>> + outbuf[j++] = '\n'; /* CR -> CR LF */
>
> This sends a CR-LF End-of-Line, but as a response to Ctrl-M.
Is that wrong or what? I don't understand what you want to say.
> In line mode
> the telnet client reads Ctrl-J or LF when the user presses enter.
I am not even familiar with this line mode thingy.
Let me experiment... ok, so in line more we see '\n'
from keyboard, not '\r'.
> The right thing to do would be to revert this change and to add
> + else if (c == '\n' && G.charmode != CHM_ON) {
> + outbuf[j] = '\r'; /* LF -> CR LF */
>
> + outbuf[j++] = '\n';
> + }
Probably...
More information about the busybox
mailing list