From 575ecb340a08391c03a7bd049728dfa976f6c22d Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Tue, 5 Sep 1995 17:34:29 +0000 Subject: [PATCH] Delay starting login process until option negotiation is complete to avoid race condition on connections with larger round-trip-times. Submitted by: John Capo & Peter Wemm --- libexec/telnetd/telnetd.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index 87e017da7692..155ef56442a9 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -740,11 +740,7 @@ char *hostname; char host_name[MAXHOSTNAMELEN]; char remote_host_name[MAXHOSTNAMELEN]; -#ifndef convex -extern void telnet P((int, int)); -#else extern void telnet P((int, int, char *)); -#endif /* * Get a pty, scan input lines. @@ -834,12 +830,6 @@ doit(who) level = getterminaltype(user_name); setenv("TERM", terminaltype ? terminaltype : "network", 1); - /* - * Start up the login process on the slave side of the terminal - */ -#ifndef convex - startslave(host, level, user_name); - #if defined(_SC_CRAY_SECURE_SYS) if (secflag) { if (setulvl(dv.dv_actlvl) < 0) @@ -849,10 +839,8 @@ doit(who) } #endif /* _SC_CRAY_SECURE_SYS */ - telnet(net, pty); /* begin server processing */ -#else - telnet(net, pty, host); -#endif + telnet(net, pty, host); /* begin server process */ + /*NOTREACHED*/ } /* end of doit */ @@ -876,15 +864,9 @@ Xterm_output(ibufp, obuf, icountp, ocount) * hand data to telnet receiver finite state machine. */ void -#ifndef convex -telnet(f, p) -#else telnet(f, p, host) -#endif int f, p; -#ifdef convex char *host; -#endif { int on = 1; #define TABBUFSIZ 512 @@ -1120,9 +1102,12 @@ telnet(f, p, host) {sprintf(nfrontp, "td: Entering processing loop\r\n"); nfrontp += strlen(nfrontp);}); -#ifdef convex + /* + * Startup the login process on the slave side of the terminal + * now. We delay this until here to insure option negotiation + * is complete. + */ startslave(host); -#endif for (;;) { fd_set ibits, obits, xbits;