Telnet and carriage return.
Ralf Friedl
Ralf.Friedl at online.de
Thu Sep 13 08:53:38 UTC 2012
Arnaud Rébillout wrote:
>> Also, any SMTP server I've ever used accepts NL-only (with
>> no CR) input, so for interactive use rather than script use (wherein
>> the latter you would want to be fully robust against strict servers),
>> it probably doesn't matter anyway...
> I'm experimenting with a gmail server at the moment. It works well
> until I enter the DATA step. At this moment, the server fails to
> recognize the termination line (ie. the line containing a single dot),
> and I get stuck there with no way out. I figured out it's because of
> the missing CR character.
If that is the only place where you need the CR, you can just type it
manually: Type Ctrl-V Ctrl-M, and '^M' should appear.
> The second thing is that there is this nasty piece of code in busybox
> telnet.c source:
>
> else if (c == '\r')
> outbuf[j++] = '\0'; /* CR -> CR NUL */
>
> Hell ! For some reason, every CR has a NUL appended to it. So I had to
> remove that, and then everything works fine. Any idea about the reason
> for this stuff ? I read the comment above but it doesn't make sense to
> me...
That seems to be normal, the standard telnet client does the same. But
one difference is that the standard telnet client sends CR-LF at the end
of the line and not LF alone.
More information about the busybox
mailing list