restore local change mistakenly overrun in import of 95.10.23

telnet--keep track of a client-side close and just turn off one
direction of the socket; keep running until server side closes down too.
This commit is contained in:
jtk 1996-02-24 07:32:00 +00:00
parent 40d57df71a
commit 42a670f945
3 changed files with 21 additions and 14 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)externs.h 8.3 (Berkeley) 5/30/95
* $NetBSD: externs.h,v 1.6 1996/02/24 01:18:36 jtk Exp $
* $NetBSD: externs.h,v 1.7 1996/02/24 07:32:00 jtk Exp $
*/
#ifndef BSD
@ -142,7 +142,8 @@ extern int
#endif /* defined(TN3270) */
termdata, /* Print out terminal data flow */
#endif /* defined(unix) */
debug; /* Debug level */
debug, /* Debug level */
clienteof; /* Client received EOF */
extern cc_t escape; /* Escape to command mode */
extern cc_t rlogin; /* Rlogin mode escape character */

View File

@ -33,7 +33,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95"; */
static char rcsid[] = "$NetBSD: sys_bsd.c,v 1.8 1996/02/24 01:18:46 jtk Exp $";
static char rcsid[] = "$NetBSD: sys_bsd.c,v 1.9 1996/02/24 07:32:01 jtk Exp $";
#endif /* not lint */
/*
@ -1189,15 +1189,20 @@ process_rings(netin, netout, netex, ttyin, ttyout, poll)
if (c < 0 && errno == EWOULDBLOCK) {
c = 0;
} else {
/* EOF detection for line mode!!!! */
if ((c == 0) && MODE_LOCAL_CHARS(globalmode) && isatty(tin)) {
/* must be an EOF... */
*ttyiring.supply = termEofChar;
c = 1;
}
if (c <= 0) {
if (c < 0) {
return -1;
}
if (c == 0) {
/* must be an EOF... */
if (MODE_LOCAL_CHARS(globalmode) && isatty(tin)) {
*ttyiring.supply = termEofChar;
c = 1;
} else {
clienteof = 1;
shutdown(net, 1);
return 0;
}
}
if (termdata) {
Dump('<', ttyiring.supply, c);
}

View File

@ -33,7 +33,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95"; */
static char rcsid[] = "$NetBSD: telnet.c,v 1.5 1996/02/24 01:18:48 jtk Exp $";
static char rcsid[] = "$NetBSD: telnet.c,v 1.6 1996/02/24 07:32:03 jtk Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -105,7 +105,8 @@ int
donelclchars, /* the user has set "localchars" */
donebinarytoggle, /* the user has put us in binary */
dontlecho, /* do we suppress local echoing right now? */
globalmode;
globalmode,
clienteof = 0;
char *prompt = 0;
@ -2098,9 +2099,9 @@ Scheduler(block)
ttyout = ring_full_count(&ttyoring);
#if defined(TN3270)
ttyin = ring_empty_count(&ttyiring) && (shell_active == 0);
ttyin = ring_empty_count(&ttyiring) && (clienteof == 0) && (shell_active == 0);
#else /* defined(TN3270) */
ttyin = ring_empty_count(&ttyiring);
ttyin = ring_empty_count(&ttyiring) && (clienteof == 0);
#endif /* defined(TN3270) */
#if defined(TN3270)