Change binary mode to do just that, and add a eight-bit mode for just

passing all characters.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4064 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-11-29 02:28:37 +00:00
parent 3d4c84ec7b
commit 0b32f6e068
4 changed files with 12 additions and 7 deletions

View File

@@ -56,6 +56,7 @@ extern int
autologin, /* Autologin enabled */
skiprc, /* Don't process the ~/.telnetrc file */
eight, /* use eight bit mode (binary in and/or out */
binary,
flushout, /* flush output */
connected, /* Are we connected to the other side? */
globalmode, /* Mode tty should be in */

View File

@@ -127,6 +127,9 @@ main(int argc, char **argv)
case '7':
eight = 0;
break;
case 'b':
binary = 3;
break;
case 'D': {
/* sometimes we don't want a mangled display */
char *p;

View File

@@ -35,7 +35,7 @@
RCSID("$Id$");
#define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x))
#define strip(x) (eight ? (x) : ((x) & 0x7f))
static unsigned char subbuffer[SUBBUFSIZE],
*subpointer, *subend; /* buffer for sub-options */
@@ -56,6 +56,7 @@ char will_wont_resp[256];
int
eight = 3,
binary = 0,
autologin = 0, /* Autologin anyone? */
skiprc = 0,
connected,
@@ -1594,9 +1595,9 @@ telrcv(void)
telrcv_state = TS_IAC;
break;
}
/*
/*
* The 'crmod' hack (see following) is needed
* since we can't * set CRMOD on output only.
* since we can't set CRMOD on output only.
* Machines like MULTICS like to send \r without
* \n; since we must turn off CRMOD to get proper
* input, the mapping is done here (sigh).
@@ -2026,8 +2027,8 @@ telnet(char *user)
send_do(TELOPT_STATUS, 1);
if (env_getvalue((unsigned char *)"DISPLAY"))
send_will(TELOPT_XDISPLOC, 1);
if (eight)
tel_enter_binary(eight);
if (binary)
tel_enter_binary(binary);
}
for (;;) {

View File

@@ -163,10 +163,10 @@ getconnmode(void)
if (localflow)
mode |= MODE_FLOW;
if (my_want_state_is_will(TELOPT_BINARY))
if ((eight & 1) || my_want_state_is_will(TELOPT_BINARY))
mode |= MODE_INBIN;
if (his_want_state_is_will(TELOPT_BINARY))
if ((eight & 2) || his_want_state_is_will(TELOPT_BINARY))
mode |= MODE_OUTBIN;
#ifdef KLUDGELINEMODE