This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New package: suite3270-3.2.20-1

On Mon, Nov 17, 2003 at 02:51:15PM -0800, Peter A. Castro wrote:
> After getting a successful login I did the following:
> doctor@garfunkel[501] ~ $ od -c
> <ret>
> <ret>
> <ret>
> <ctrl-j>
> <ctrl-j>
> <ctrl-j>
> <ctrl-d>
> 0000000  \0  \n  \0  \n  \0  \n  \0  \n  \n  \n
> 0000012
> Notice the \0's ?  From above, if the crlf option is turned off, the
> client sends 0x0d,0x00.  It appears the telnet daemon is forwarding on
> the 0x00 as part of the data stream.  According to RFC 854, a <cr><nul>
> combination is supposed to be treated as a straight carriage-return, so
> the daemon is supposed to turn that pair of characters into a single <cr>
> character.  You can run c3270 in trace mode ("c3270 -trace <hostname>"

Hmm, I had a look into telnetd and it actually does conform to RFC 854,
AFAICS.  There's a function called "telrcv()", which apparently cares
for receiving characters from the client side.  There's this stuff in
the code:

	case TS_CR:
		state = TS_DATA;
		/* Strip off \n or \0 after a \r */
		if ((c == 0) || (c == '\n')) {
	case TS_DATA:

As it turns out, telnetd is operating in so-called "LINEMODE".  An
explanation of linemode is given in telnetd/termstat.c though it's
not entirely clear to me how it works, admittedly.  Linemode seems
to speed up the connection at least.

Anyway, if linemode is enabled (which is negotiated on server startup),
telnetd never calls the above code, since a few lines below it turns a
\r into a \n.  When compiling telnetd without -DLINEMODE, that telnetd
is able to operate with c3270 as expected.  It's also able to work
fine with a Linux and the Cygwin telnet client. 

On the other hand, telnetd on BSD systems is by default also build
with linemode on!  So it's not quite clear to me what to do or if I
should do anything at all.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]