Index: user/telnetd/utility.c =================================================================== diff -u -r1.1.1.1 utility.c --- user/telnetd/utility.c 1999/11/22 03:47:58 1.1.1.1 +++ user/telnetd/utility.c 2001/07/09 00:13:12 @@ -47,6 +47,11 @@ #include "telnetd.h" +#include +#include +#include + + /* * utility functions performing io related tasks */ @@ -63,12 +68,30 @@ void ttloop(void) { + fd_set rfds; + struct timeval tm; + int n; DIAG(TD_REPORT, {sprintf(nfrontp, "td: ttloop\r\n"); nfrontp += strlen(nfrontp);}); if (nfrontp-nbackp) { netflush(); } +#if 1 + do { + FD_ZERO(&rfds); + FD_SET(net, &rfds); + tm.tv_sec = 0 /* 2 */; + tm.tv_usec = 0; + + n = select(net + 1, &rfds, NULL, NULL, &tm); + DIAG(TD_ERR, {sprintf(nfrontp, "td: ttloop select=%d\r\n", n); + nfrontp += strlen(nfrontp);}); + if (nfrontp-nbackp) { + netflush(); + } + } while (n == 0); +#endif ncc = read(net, netibuf, sizeof netibuf); if (ncc < 0) { /*syslog(LOG_INFO, "ttloop: read: %m\n")*/;