Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 1997 16:28:26 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, davidn@labs.usn.blaze.net.au
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, davidn@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libutil login_auth.c
Message-ID:  <199707190628.QAA29484@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>  >  Modified files:
>>  >    lib/libutil          login_auth.c 
>>  >  Log:
>>  >  sleep() after sending 'nologin' file to ensure output is drained before
>>  >  disconnect.
>>  
>>  This should use tcdrain(3).
>
>Well, no, it doesn't appear to be an operating system issue. The
>sleep() is done after the close(). The problem occurs when DCD
>on a serial port is lowered before the *modem* has sent all of
>its data, and I can easily reproduce the problem on a telnet

What modem?  Output might be connected to the console, and then an
unnecessary sleep is very annoying.

>connection as well (due to telnet's usual misfeature of quitting
>early). tcdrain() before the close() has no effect - I tried that
>before I understood the problem.

This might be caused by driver bugs.  Draining didn't work right in
sio before rev.1.152 (1996/11/30), and corresponding fixes haven't
been made in any other serial drivers :-(.

Telnet seems to work right here.  I tried a 75K file for /etc/nologin.

It's hard handle the modem hanging up before sending all the data that
has been sent to it.  A naive calculation like

	sleeptime = howmany(filesize, DTEspeed / 10);

is very wrong if the effective line speed is much smaller than the DTE
speed or the file size is much smaller than the modem buffer size.

Bruce



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