On Thu, Sep 13, 2012 at 4:48 PM, Ralf Friedl <[email protected]> wrote:
>>> 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.
>>
>
> This change converts CR to CR-LF. But to type CR you have to press Ctrl-V
> Ctrl-M, not the enter key. The enter key is read as LF or '\n'.
No, in raw tty mode Enter key sends ^M = '\r' = CR.
> This the "end-of-line" key or "Return" or "Enter" from RFC1123 section 3.3.1.
Parse error.
Anyway, practical considerations demand that keyboard Enter key
should be usable as end-of-line for telnet users.
> According to this section, "end-of-line" or LF should be sent by default to
> a telnet server and what must be sent to a non telnet server.
Really?
A User Telnet MUST be able to send any of the forms: CR LF, CR
NUL, and LF. A User Telnet on an ASCII host SHOULD have a
user-controllable mode to send either CR LF or CR NUL when the
user presses the "end-of-line" key, and CR LF SHOULD be the default.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When a user presses the "end-of-line" key, some User
Telnet implementations send CR LF, while others send CR
NUL (based on a different interpretation of the same
sentence in RFC-854). These will be equivalent for a
correctly-implemented ASCII server host, as discussed
above. For other servers, a mode in the User Telnet is
needed.
The existence of User Telnets that send only CR NUL when
CR is pressed creates a dilemma for non-ASCII hosts: they
can either treat CR NUL as equivalent to CR LF in input,
thus precluding the possibility of entering a "bare" CR,
or else lose complete interworking.
> I looked at the behavior of the standard telnet client when talking to an
> SMTP server (and probably to any non telnet server) and it is this:
> CR -> CR NUL
Well, smtp isn't going to understand what this means.
> LF -> CR LF
>
> So a single CR is converted to CR NUL to show the server that CR or '\r' or
> Ctrl-M was pressed.
> A single LF is converted to CR LF to show the server that LF or '\n' or
> Ctrl-J was pressed.
What are "single CR" and "single LF" in terms of
what keys user presses on the keyboard?
To me it looks like we should ensure that Enter key
sends something which is understood as end-of-line.
Since Enter produces CR _or_ LF (depending on mode),
how about we just always replace both of them with
CR+LF pair?
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox