Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Dec 1996 02:51:24 -0700 (MST)
From:      Ade Barkah <mbarkah@hemi.com>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@freebsd.org
Subject:   Re: bug in 2.2-alpha loopback (?)
Message-ID:  <199612090951.CAA15644@hemi.com>
In-Reply-To: <199612080824.TAA19537@godzilla.zeta.org.au> from "Bruce Evans" at Dec 8, 96 07:24:22 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:

> >Sorry, I wasn't very careful considering all the variables. This
> >might be a "telnet" problem instead of a loop interface problem
> 
> See another thread in freebsd-bugs about bugs in telnet LINEMODE.

[...program deleted...]

> Run this and type `1^D' where ^D is the eof character for the tty.  The
> read should return 1, but in telnet LINEMODE it doesn't return.  The
> eol character is similarly broken (when set).  The eol2 character works.

Yeah... it fails to process the EOF unless it's the first character 
of the line. =-(

J Wunsch wrote:

> Since the network server on Machine C is not a telnet server, linemode
> negotiation should IMHO not occur, and the connection should rather
> remain in character-at-a-time mode anyway, but i better leave the
> actual interpretation to the telnet gurus. :)

I think it is fine for the telnet client to default in LINEMODE. In 
fact, I think Unix telnet has always defaulted to linemode since "way 
back when" (VMS ones stay in character mode.) I've seen many naive 
servers on the net (muds, chatlines, etc.) depend on the client 
starting in LINEMODE.

The question is then, when the input tty is closed, should the client 
send an actual EOF character to the server or simply close the output 
connection ? Currently telnet forces out an EOF character by doing:

(from sys_bsd.c:)

[...up here somewhere basically (c = read (tin... ))...]

| /* EOF detection for line mode!!!! */
| if ((c == 0) && MODE_LOCAL_CHARS(globalmode) && isatty(tin)) {
| /* must be an EOF... */
|    *ttyiring.supply = termEofChar;
|    c = 1;
| }

If I #ifdef out the above lines, things then work as I expect
(erm, as I want, I mean.) In the mean time I'll check for an
explicit EOF character in my programs.

Thanks for all the replies,

-Ade
ps. Is David Borman the correct person to bug ?
-------------------------------------------------------------------
Inet: mbarkah@hemi.com - HEMISPHERE ONLINE - <http://www.hemi.com/>;
-------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612090951.CAA15644>