[news.software.nn] Interactive rlogin problem with nn SOLVED

andy@xwkg.Icom.Com (Andrew H. Marrinson) (10/30/90)

Wow, I found what was happening!  The problem was that when doing the
ioctl to set the terminal mode to and from raw mode nn was using TCSETAF,
which means set parameters and flush.  Evidently, if this happened with
a partially complete packet still to be sent, that packet would be
flushed using the urgent pointer as described in my previous posting.
This led to the missing data.

The fix was to use TCSETAW instead.  I will file a proper bug report with
context diff to nn-bugs.  For those who want to fix it now, here's the
change to term.c, but note that it is not an official patch.

This bug potentially affects all Unix systems with termio, but is likely
to appear only with certain networking programs (e.g. ISC's rlogin) or
very slow communication lines.

*** term.c	Mon Oct 29 17:05:08 1990
--- term.c.old	Mon Oct 29 17:39:54 1990
***************
*** 670,677 ****
  static int is_raw = 0;
  
  #ifdef HAVE_TERMIO
! #define RAW_MODE_ON    ioctl(0, TCSETAW, &raw_tty)
! #define RAW_MODE_OFF   ioctl(0, TCSETAW, &norm_tty)
  #else
  #define RAW_MODE_ON    ioctl(0, TIOCSETP, &raw_tty)
  #define RAW_MODE_OFF   ioctl(0, TIOCSETP, &norm_tty)
--- 670,677 ----
  static int is_raw = 0;
  
  #ifdef HAVE_TERMIO
! #define RAW_MODE_ON    ioctl(0, TCSETAF, &raw_tty)
! #define RAW_MODE_OFF   ioctl(0, TCSETAF, &norm_tty)
  #else
  #define RAW_MODE_ON    ioctl(0, TIOCSETP, &raw_tty)
  #define RAW_MODE_OFF   ioctl(0, TIOCSETP, &norm_tty)
--
		Andrew H. Marrinson
		Icom Systems, Inc.
		Wheeling, IL, USA
		(andy@icom.icom.com)

jaap@sequent.UUCP (Jaap Vermeulen) (10/30/90)

andy@xwkg.Icom.Com (Andrew H. Marrinson) writes:

>Wow, I found what was happening!  The problem was that when doing the
>ioctl to set the terminal mode to and from raw mode nn was using TCSETAF,
>which means set parameters and flush.  Evidently, if this happened with
>a partially complete packet still to be sent, that packet would be
>flushed using the urgent pointer as described in my previous posting.
>This led to the missing data.

Good work!
I know that several people were running into this problem.
The initial culprit was thought to be the XON/XOFF settings of the line
somewhere (at least that is what I understood).

If you're ever in Portland, I'll buy you lunch :-)

	-Jaap-
-- 
Jaap Vermeulen					+--------------------------+
						| Sequent Computer Systems |
	Internet : jaap@sequent.com		| Beaverton, Oregon	   |
	Uucp	 : ...uunet!sequent!jaap	+--------------------------+

pim@cti-software.nl (Pim Zandbergen) (11/01/90)

andy@xwkg.Icom.Com (Andrew H. Marrinson) writes:

>The fix was to use TCSETAW instead.  

I solved this problem without changing the source by specifying
"unset flow-control" in the init file. This works both on "normal"
and rlogin sessions and does not unset XON/XOFF or anything.

-- 
Pim Zandbergen                          domain : pim@cti-software.nl
CTI Software BV                         uucp   : uunet!mcsun!hp4nl!ctisbv!pim
Laan Copes van Cattenburch 70           phone  : +31 70 3542302
2585 GD The Hague, The Netherlands      fax    : +31 70 3512837