home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c / ucterak.bwr < prev    next >
Text File  |  2020-01-01  |  6KB  |  175 lines

  1. 19-Aug-87 06:14:14-EDT,5994;000000000001
  2. Return-Path: <SYSKERMIT%vax1.central.lancaster.ac.uk@Cs.Ucl.AC.UK>
  3. Received: from Cs.Ucl.AC.UK (TUNNEL.CS.UCL.AC.UK) by CU20B.COLUMBIA.EDU with TCP; Wed 19 Aug 87 06:13:18-EDT
  4. Received: from vax1.central.lancaster.ac.uk by nss.Cs.Ucl.AC.UK 
  5.            via Janet with NIFTP  id aa04934; 19 Aug 87 11:11 BST
  6. Date:        19-AUG-1987 11:11:20
  7. From:        SYSKERMIT%vax1.central.lancaster.ac.uk@Cs.Ucl.AC.UK
  8. To:        INFO-KERMIT <@nss.cs.ucl.ac.uk:INFO-KERMIT@cu20b.columbia.edu>
  9. Subject:    Update to KERMIT for UCSD(UCT)
  10.  
  11.  
  12.  
  13.    In the following you will find two of the pieces of UCSD pSystem Kermit
  14. which I've altered to handle text files properly - binary file transfer is
  15. right out because, apart from anything else, the pSystem II.0 BIOS can't
  16. read/write binary files byte by byte correctly, so that's a non-starter. 
  17.  
  18.    I originally fixed the bug that the receive routines expected the sequence
  19. '#M#J' to occur together, so a '#M' at the end of a message followed by '#J' at
  20. the start of the next got things confused. The final fix is to totally ignore
  21. all '#'-codes except the sequence '#M#J' (whether adjacent or not), so as to
  22. ensure reliable text file transfer *without* confusing the filing system with
  23. unexpected control characters. 
  24.  
  25.    The changes are to RECSW.TEXT and KERMIT.TEXT which are part of the
  26. concatenated source [.UCT]UCTERAK.PAS. Diff listings for these two files are
  27. below. 
  28.  
  29. Nick Rothwell,   Laboratory for Foundations of Computer Science,
  30.                  University of Edinburgh.
  31.                  ARPA:    nick%{cstvax,itspna}.ed.ac.uk@cs.ucl.ac.uk
  32.                  JANET:   nick@uk.ac.ed.{cstvax,itspna}
  33.                  UUCP:    <Atlantic Ocean>!mcvax!ukc!{cstvax,itspna}!nick
  34.  
  35.  
  36. ************
  37. File KERMIT.OLD;1
  38.     1   >>>>> KERMIT.TEXT
  39.     2   program kermit;
  40.     3   
  41.     4   (* $R-*) (* turn range checking off *)
  42. ******
  43. File KERMIT.NEW;3
  44.     1   >>>> KERMIT.TEXT
  45.     2   program kermit;
  46.     3   
  47.     4   {Fixed by NICK: the receive routines ('bufemp') assumed that #M and #J
  48.     5    always occurred together, so an isolated #J would write a spurious linefeed.
  49.     6    This is fixed. We also ignore any '#' codes except the sequence #M#J.
  50.     7   
  51.     8   }
  52.     9    
  53.    10   (* $R-*) (* turn range checking off *)
  54. ************
  55. ************
  56. File KERMIT.OLD;1
  57.     7   (*$U PARSELIB.CODE*)
  58.     8   USES PARSER;
  59.     9   
  60. ******
  61. File KERMIT.NEW;3
  62.    13   USES {$U PARSELIB.CODE} PARSER;
  63.    14   
  64. ************
  65. ************
  66. File KERMIT.OLD;1
  67.    94   
  68. ******
  69. File KERMIT.NEW;3
  70.    99       HaveHashM: Boolean;   {NICK}
  71.   100   
  72. ************
  73. ************
  74. File KERMIT.OLD;1
  75.   429   
  76.   430   (* empties a packet into a file *)
  77. ******
  78. File KERMIT.NEW;3
  79.   435     {NICK: This procedure heavily modified}
  80.   436   (* empties a packet into a file *)
  81. ************
  82. ************
  83. File KERMIT.OLD;1
  84.   450           if (r.i = cr) then          (* else if a carriage return then *)
  85.   451             begin
  86.   452               i := i + 3;               (* skip over that and line feed *)
  87.   453               (*$I-*)                   (* turn i/o checking off *)
  88.   454               writeln(f,s);             (* and write out line to file *)
  89.   455               s := copy('',0,0);        (* empty the string var *)
  90.   456               ls := 0;
  91.   457               if (io_result <> 0) then  (* if io_error *)
  92.   458                 begin
  93.   459                   io_error(ioresult);     (* tell them and *)
  94.   460                   state := 'a';           (* abort *)
  95.   461                 end (* if *)
  96.   462             end
  97.   463         (*$I+*)                      (* turn i/o checking back on *)
  98. ******
  99. File KERMIT.NEW;3
  100.   456           if (r.i = cr) then begin
  101.   457             i := i + 1;
  102.   458             HaveHashM := True;   {NICK}
  103.   459           end else if (r.i = lf) then
  104.   460             begin
  105.   461              {NICK:}
  106.   462               i := i + 1;               (* skip over that ... *)
  107.   463               IF HaveHashM then begin   {NICK: write line ONLY if #M#J}
  108.   464                 (*$I-*)                   (* turn i/o checking off *)
  109.   465                 writeln(f,s);             (* and write out line to file *)
  110.   466                 s := copy('',0,0);        (* empty the string var *)
  111.   467                 ls := 0;
  112.   468                 if (io_result <> 0) then  (* if io_error *)
  113.   469                   begin
  114.   470                     io_error(ioresult);     (* tell them and *)
  115.   471                     state := 'a';           (* abort *)
  116.   472                   end (* if *)
  117.   473               end;
  118.   474               HaveHashM := False
  119.   475             end
  120.   476           else if (r.ch < ' ') then begin
  121.   477             i := i + 1;   {NICK: ignore any other control}
  122.   478             HaveHashM := false
  123.   479           end
  124.   480         (*$I+*)                      (* turn i/o checking back on *)
  125. ************
  126. ************
  127. File KERMIT.OLD;1
  128.   466               r.i := aand(r.i,127);     (* mask off parity bit *)
  129. ******
  130. File KERMIT.NEW;3
  131.   483                HaveHashM := false;
  132.   484               r.i := aand(r.i,127);     (* mask off parity bit *)
  133. ************
  134. ************
  135. File KERMIT.OLD;1
  136.   483   function bufill(*var buffer: packettype): integer*);
  137. ******
  138. File KERMIT.NEW;3
  139.   501   
  140.   502   function bufill(*var buffer: packettype): integer*);
  141. ************
  142. ************
  143. File KERMIT.OLD;1
  144.  1142   
  145. ******
  146. File KERMIT.NEW;3
  147. ************
  148.  
  149. ----------------------------------------------------------------
  150. ************
  151. File RECSW.OLD;2
  152.     3   
  153.     4   (* RECEIVE SECTION *)
  154. ******
  155. File RECSW.NEW;2
  156.     3   (* RECEIVE SECTION *)
  157. ************
  158. ************
  159. File RECSW.OLD;2
  160.   315   
  161. ******
  162. File RECSW.NEW;2
  163.   314       HaveHashM := False;      {NICK: clear the #M#J state flag}
  164.   315   
  165. ************
  166. ************
  167. File RECSW.OLD;2
  168. ******
  169. File RECSW.NEW;2
  170.   337   
  171. ************
  172.  
  173.  
  174. -------
  175.