From owner-cvs-lib Fri Jul 18 23:34:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA10309 for cvs-lib-outgoing; Fri, 18 Jul 1997 23:34:26 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA10274; Fri, 18 Jul 1997 23:34:18 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id QAA29484; Sat, 19 Jul 1997 16:28:26 +1000 Date: Sat, 19 Jul 1997 16:28:26 +1000 From: Bruce Evans Message-Id: <199707190628.QAA29484@godzilla.zeta.org.au> To: bde@zeta.org.au, davidn@labs.usn.blaze.net.au Subject: Re: cvs commit: src/lib/libutil login_auth.c Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, davidn@FreeBSD.ORG Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> > 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