summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-06-29 22:17:59 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-06-29 22:17:59 +0800
commitc0a22dee78c1470d62d658e1b2beacb84ffb5cc5 (patch)
tree463fbd38518dffa479767dfc59a8cc69225da29e /mbbsd/io.c
parent3cbefc4792908b0b0f7433f6565958032e01b241 (diff)
downloadpttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar.gz
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar.bz2
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar.lz
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar.xz
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.tar.zst
pttbbs-c0a22dee78c1470d62d658e1b2beacb84ffb5cc5.zip
Reverting revision 2098 and 2100. These make kernel panic due to out of swap.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2101 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c57
1 files changed, 2 insertions, 55 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 3282b041..584faa29 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -10,7 +10,7 @@
#define IBUFSIZE 256
#endif
-static char outbuf[OBUFSIZE];
+static char outbuf[OBUFSIZE], inbuf[IBUFSIZE];
static int obufsize = 0, ibufsize = 0;
static int icurrchar = 0;
@@ -47,15 +47,12 @@ oflush()
}
}
-#if 0
void
init_buf()
{
memset(inbuf, 0, IBUFSIZE);
}
-#endif
-
void
output(char *s, int len)
{
@@ -124,7 +121,6 @@ dogetch()
{
int len;
static time_t lastact;
- static unsigned char inbuf[IBUFSIZE];
if (ibufsize <= icurrchar) {
if (flushf)
@@ -181,7 +177,7 @@ dogetch()
}
#ifdef SKIP_TELNET_CONTROL_SIGNAL
- } while( inbuf[0] == IAC );
+ } while( inbuf[0] == -1 );
#endif
ibufsize = len;
icurrchar = 0;
@@ -227,56 +223,7 @@ igetch()
else // here is switch for default keys
switch (ch) {
case IAC:
-#ifndef SKIP_TELNET_CONTROL_SIGNAL
- {
- unsigned char cmd[16];
- ch = dogetch();
- switch (ch) {
- case IAC:
- return IAC; /* escaped IAC */
-
- case DO:
- cmd[0] = IAC;
- cmd[1] = WONT; /* this always work according to rfc 854 */
- cmd[2] = dogetch();
- if(cmd[1] != TELOPT_TTYPE && cmd[1] != TELOPT_NAWS &&
- cmd[1] != TELOPT_ECHO && cmd[1] != TELOPT_SGA)
- write(1, cmd, 3);
- break;
-
- case DONT:
- cmd[0] = IAC;
- cmd[1] = WONT;
- cmd[2] = dogetch();
- write(1, cmd, 3);
- break;
-
- case WILL: case WONT:
- cmd[2] = dogetch();
- break;
-
- case SB:
- {
- int i;
- ch = 0; /* use as mode */
- for (i = 2; i < 16; ++i) {
- cmd[i] = dogetch();
- if (cmd[i] == IAC)
- ch ^= 1;
- else if (ch && cmd[i] == SE)
- break;
- else
- mode = 0;
- }
- }
- if (cmd[2] == TELOPT_NAWS)
- telnet_parse_size(cmd);
-
- } /* switch first char after IAC */
- }
-#endif /* ! defined SKIP_TELNET_CONTROL_SIGNAL */
continue;
-
#ifdef DEBUG
case Ctrl('Q'):{
struct rusage ru;