diff -c +new-file term.old/CHANGES term/CHANGES
*** term.old/CHANGES	Sun Dec 27 12:36:39 1992
--- term/CHANGES	Sun Dec 27 15:20:11 1992
***************
*** 379,382 ****
  	local socket.
  
  	Fixed the sevenbit support a bit. It was still possible for
! 	term to try to generate packets longer than 127 bytes.

--- 379,385 ----
  	local socket.
  
  	Fixed the sevenbit support a bit. It was still possible for
! 	term to try to generate packets longer than 127 bytes.
! 0.9.6 --> 0.9.7
! 	Fixed compression for seven bit mode.
! 	
diff -c +new-file term.old/checksum.c term/checksum.c
*** term.old/checksum.c	Fri Dec 18 11:56:17 1992
--- term/checksum.c	Sun Dec 27 14:53:45 1992
***************
*** 89,99 ****
  
  #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
  
! unsigned short check_sum(unsigned char *d, int len)
  {
    unsigned short crc = 0;
    while (len-->0)
!     crc = updcrc(*d++, crc);
  
    return crc;
  }
--- 89,99 ----
  
  #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
  
! unsigned short check_sum(unsigned char *d, int len, int mask)
  {
    unsigned short crc = 0;
    while (len-->0)
!     crc = updcrc((*d++) & mask, crc);
  
    return crc;
  }
Binary files term.old/checksum.o and term/checksum.o differ
Binary files term.old/client.a and term/client.a differ
Binary files term.old/client.o and term/client.o differ
diff -c +new-file term.old/compress.c term/compress.c
*** term.old/compress.c	Sat Dec 26 14:29:14 1992
--- term/compress.c	Sun Dec 27 15:15:45 1992
***************
*** 1,8 ****
  /*
  ** Copyright Michael O'Reilly. All rights reserved.
  */
- 
  #include "includes.h"
  				/* Following used for debugging. */
  #if 0
  #define ASSERT(a) \
--- 1,8 ----
  /*
  ** Copyright Michael O'Reilly. All rights reserved.
  */
  #include "includes.h"
+ #include "debug.h"
  				/* Following used for debugging. */
  #if 0
  #define ASSERT(a) \
***************
*** 122,128 ****
              bit,
              read = 0,
              tmp;
- 
      byte = *curr / BYTE_WIDTH_IN;
      bit = *curr % BYTE_WIDTH_IN;
      ret = 0;
--- 122,127 ----
***************
*** 134,139 ****
--- 133,139 ----
      }
      ret = ret & unc_token_mask;
      *curr += unc_token_bits;
+     DEBUG_C(stderr, "c_got: %d\n", ret);
      return (unsigned int) ret;
  }
  
***************
*** 140,145 ****
--- 140,146 ----
  void put_token (unsigned char *data, int *curr, unsigned int ch) {
      int     byte,
              bit;
+     DEBUG_C(stderr, "c_put: %d\n", ch);
      byte = *curr / BYTE_WIDTH_OUT;
      bit = *curr % BYTE_WIDTH_OUT;
      ch = ch & c_token_mask;
***************
*** 328,334 ****
    }
    put_token (outpath, &out_fd, prfix -> num); /* Put the last token we */
  					      /* had out. */
!   stat_comp_out += (out_fd+7) / 8;
    return out_fd;
  }
  
--- 329,335 ----
    }
    put_token (outpath, &out_fd, prfix -> num); /* Put the last token we */
  					      /* had out. */
!   stat_comp_out += (out_fd+BYTE_WIDTH_OUT - 1) / BYTE_WIDTH_OUT;
    return out_fd;
  }
  
Binary files term.old/compress.o and term/compress.o differ
diff -c +new-file term.old/debug.h term/debug.h
*** term.old/debug.h	Sat Nov 28 13:05:12 1992
--- term/debug.h	Sun Dec 27 15:03:43 1992
***************
*** 24,26 ****
--- 24,29 ----
  
  #define DEBUG_LL \
           (!(debug & 256)) ? 0 : fprintf
+ 
+ #define DEBUG_C \
+          (!(debug & 512)) ? 0 : fprintf
Binary files term.old/lib.o and term/lib.o differ
diff -c +new-file term.old/link.c term/link.c
*** term.old/link.c	Sun Dec 27 12:24:06 1992
--- term/link.c	Sun Dec 27 15:17:26 1992
***************
*** 104,109 ****
--- 104,110 ----
  /* For now , we just get some bytes */
  /* we are compressing now. */
  int get_data(char *b, int len) {
+   extern int tok_byte_width_out;
    int i, j, k;
    /* this is a horrible kludge, but without major reorignization, 
     * this is the simplest way.  we need to know if the current 
***************
*** 118,124 ****
    if ( k < 0 )			/* no data */
    	return 0;
    if (curr_client->compress && (j = compress(b, len-1, k)) > 0)  {
!     j = ( j + 7) /8;
      return -j;
    }
    else {
--- 119,125 ----
    if ( k < 0 )			/* no data */
    	return 0;
    if (curr_client->compress && (j = compress(b, len-1, k)) > 0)  {
!     j = ( j + tok_byte_width_out - 1) / tok_byte_width_out;
      return -j;
    }
    else {
Binary files term.old/link.o and term/link.o differ
Binary files term.old/main.o and term/main.o differ
Binary files term.old/meta.o and term/meta.o differ
Binary files term.old/misc.o and term/misc.o differ
diff -c +new-file term.old/pty.c term/pty.c
*** term.old/pty.c	Sun Dec 27 10:13:17 1992
--- term/pty.c	Sun Dec 27 15:19:38 1992
***************
*** 1,5 ****
  
! #define VERSION	"0.9.6"
  #define I_IOCTL
  #define I_ERRNO
  #define I_SYS
--- 1,5 ----
  
! #define VERSION	"0.9.7"
  #define I_IOCTL
  #define I_ERRNO
  #define I_SYS
Binary files term.old/pty.o and term/pty.o differ
Binary files term.old/redir.o and term/redir.o differ
diff -c +new-file term.old/remote.log term/remote.log
*** term.old/remote.log
--- term/remote.log	Sun Dec 27 15:19:06 1992
***************
*** 0 ****
--- 1,2 ----
+ test:EWOULDBLOCK
+ client gave this: Try again
Binary files term.old/select.o and term/select.o differ
diff -c +new-file term.old/serial.c term/serial.c
*** term.old/serial.c	Sat Dec 26 13:51:02 1992
--- term/serial.c	Sun Dec 27 14:50:47 1992
***************
*** 231,237 ****
    
    for (j = 0; j < p_out[l].len;++ j)
      put_serial(p_out[l].data[j]);
!   j = check_sum(p_out[l].data, j );
    DEBUG_CHECK(stderr, "%s:p %d len %d checksum == %x\n", server, 
  	      l, p_out[l].len , j);
    put_serial(j & 255);
--- 231,237 ----
    
    for (j = 0; j < p_out[l].len;++ j)
      put_serial(p_out[l].data[j]);
!   j = check_sum(p_out[l].data, j , out_mask);
    DEBUG_CHECK(stderr, "%s:p %d len %d checksum == %x\n", server, 
  	      l, p_out[l].len , j);
    put_serial(j & 255);
***************
*** 302,310 ****
  	break;			/* more to read yet */
  				/* Ok. We have the whole header. Check */
  				/* the checksum */ 
!       i = update_crc(update_crc(update_crc(0, header[0]), header[1]),
! 		     header[2]); 
!       if (!check_match( i & 255,header[3])) {
  	DEBUG_CHECK(stderr, "%s:d_s_i: check calc %x, read %x\n", 
  		    server, i, header[3]);
  				/* checksum failed. treat it as noise */
--- 302,310 ----
  	break;			/* more to read yet */
  				/* Ok. We have the whole header. Check */
  				/* the checksum */ 
!       i = update_crc(update_crc(update_crc(0, header[0]&in_mask),
! 				header[1]&in_mask), header[2]&in_mask); 
!       if (!check_match( i & in_mask,header[3])) {
  	DEBUG_CHECK(stderr, "%s:d_s_i: check calc %x, read %x\n", 
  		    server, i, header[3]);
  				/* checksum failed. treat it as noise */
***************
*** 320,326 ****
  				/* we do a more strigent checksum here */
  				/* cos bad acks are a real pain in the butt */
  	DEBUG_SER(stderr, "Got ack.\n");
! 	if (!check_match(header[0] ^ header[1], header[2])) {
  	  DEBUG_CHECK(stderr,
  		      "d_s_i: secondary. calc %x, read %x\n", 
  		      header[0] ^ header[1], header[2]);
--- 320,327 ----
  				/* we do a more strigent checksum here */
  				/* cos bad acks are a real pain in the butt */
  	DEBUG_SER(stderr, "Got ack.\n");
! 	if (!check_match((header[0] ^ header[1]) & in_mask,
! 			 header[2]&in_mask)) {
  	  DEBUG_CHECK(stderr,
  		      "d_s_i: secondary. calc %x, read %x\n", 
  		      header[0] ^ header[1], header[2]);
***************
*** 379,385 ****
        j = (p_in[curr_p_num].data[curr_p_len - 1] <<8) +
  	p_in[curr_p_num].data[curr_p_len -2] ;
        
!       check = check_sum(p_in[curr_p_num].data, curr_p_len-2);
        
        if (!check_match(j, check) ) {
  	DEBUG_CHECK(stderr, "d_s_i: main calced = %x, read = %x\n", 
--- 380,386 ----
        j = (p_in[curr_p_num].data[curr_p_len - 1] <<8) +
  	p_in[curr_p_num].data[curr_p_len -2] ;
        
!       check = check_sum(p_in[curr_p_num].data, curr_p_len-2, in_mask);
        
        if (!check_match(j, check) ) {
  	DEBUG_CHECK(stderr, "d_s_i: main calced = %x, read = %x\n", 
Binary files term.old/serial.o and term/serial.o differ
Binary files term.old/socket.o and term/socket.o differ
Binary files term.old/stat.o and term/stat.o differ
Binary files term.old/term and term/term differ
diff -c +new-file term.old/term.h term/term.h
*** term.old/term.h	Sun Dec 27 09:49:00 1992
--- term/term.h	Sun Dec 27 14:53:53 1992
***************
*** 156,162 ****
  int open_system(char *);
  
  /* checksum.c */
! unsigned short check_sum(un_char *d, int len);
  unsigned short update_crc(unsigned short old, unsigned char c);
  
  /* meta.c */
--- 156,162 ----
  int open_system(char *);
  
  /* checksum.c */
! unsigned short check_sum(un_char *d, int len, int mask);
  unsigned short update_crc(unsigned short old, unsigned char c);
  
  /* meta.c */
Binary files term.old/terminal.o and term/terminal.o differ
Binary files term.old/test and term/test differ
Binary files term.old/test.o and term/test.o differ
Binary files term.old/trcmd and term/trcmd differ
Binary files term.old/tredir and term/tredir differ
Binary files term.old/trsh and term/trsh differ
Binary files term.old/trshell.o and term/trshell.o differ
Binary files term.old/tstat and term/tstat differ
Binary files term.old/tupload and term/tupload differ
Binary files term.old/txconn and term/txconn differ
Binary files term.old/upload.o and term/upload.o differ
Binary files term.old/xconn.o and term/xconn.o differ
