home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / d / modcmp.bwr < prev    next >
Text File  |  2020-01-01  |  19KB  |  516 lines

  1. 31-May-88 06:59:34-EDT,19391;000000000001
  2. Return-Path: <FDCCU@CUVMA.BITNET>
  3. Received: from CUVMA.COLUMBIA.EDU by CU20B.COLUMBIA.EDU with TCP; Tue 31 May 88 06:59:29-EDT
  4. Received: from CUVMA.COLUMBIA.EDU(MAILER) by CUVMA.COLUMBIA.EDU(SMTP) ; Tue, 31 May 88 07:00:16 EDT
  5. Received: by CUVMA (Mailer X1.25) id 2820; Tue, 31 May 88 07:00:13 EDT
  6. Date: 05/31 06:05:39
  7. From: FDCCU@CUVMA
  8. Subject: MODCMP BWR - PUN file from RSCS
  9. Tag: FILE (1754) ORIGIN DBNUAMA1 RECK      5/31/88  2:05:26 E.D.T.
  10. To: SY.FDC@CU20B
  11. Reply-To: RECK%DBNUAMA1.BITNET@CUVMA.COLUMBIA.EDU
  12.  
  13. From: Gisbert W.Selke (RECK@DBNUAMA1.BITNET)
  14. Date: 27 May 1988
  15. Re:   Modcomp Kermit - a bug and two suggestions
  16.  
  17. Frank,
  18.        I'think I found a bug in Modcomp Kermit which sometimes caused it
  19. to crash a file transfer without necessity. I think I've fixed it, and I've
  20. written a letter to the authors for clearance. The letter is appended
  21. below, together with the fixed routine (SDATA). In addition, I think one
  22. can make Modcomp Kermit cope better with a particular Modcomp peculiarity
  23. (viz., using Ctrl-A as a signal to the terminal maintenance processor -
  24. the standard Kermit start of packet must be set to something different because
  25. every once in a while TMP saw a Ctrl-A before Kermit could grab it). One can
  26. do without this change; but I think it's worth it for the sake of conformity
  27. to the rest of the Kermit world. I'd like to hear suggestions from people more
  28. knowledgeable than myself, though, before I proceed and install this change.
  29. So if you see fit, this is a matter for discussion amongst Modcomp readers of
  30. info-kermit. Otherwise, at least the SDATA fix is of general interest, I think.
  31.  
  32. \Gisbert
  33.  
  34. ------------------------ letter ----------------------------------------------
  35.  
  36. Re Modcomp Max IV Kermit 1.0 - a bug fix and a suggestion
  37.  
  38.  
  39. Dear Mr. Burke, dear Mr. Borgeson,
  40.  
  41. I have successfully installed vour Modcomp Max IV Kermit at our site. We are
  42. using version 1.0, and the sources are labeled A.0, September till October 86,
  43. mainly.
  44.  
  45. It is a fine programme, and our users appreciate the reliability and robustness
  46. it displays in everyday usage.
  47.  
  48. However, I am afraid there is a little bug somewhere down in function SDATA.
  49. This bug rears its ugly head on certain occasions when transferring a file from
  50. the Modcomp to a micro: if an ACK from the micro is lost and the micro times
  51. out, it may next send a NAK for the next packet - which the Modcomp Kermit has
  52. not sent yet, of course, since it is still waiting for the lost ACK. According
  53. to the Kermit book, if the Modcomp receives such a NAK for the next packet,
  54. this is to be interpreted as an implicit ACK for the current packet (cf. "Ker-
  55. mit-A File Transfer Protocol" by Frank da Cruz, Digital Press 1987, p. 217).
  56. This is violated by line 144 of SDATA: whenever RPACK returns a NAK, the line
  57. "IF (N.EQ.NUM-1) GO TO 50" forces SDATA to return, while line 111 has set the
  58. return code to BIGA, i. e. "Abort due to some error". The correct behaviour
  59. seems to me to branch to label 20 instead of label 50, i. e. accept the NAK for
  60. packet N+1 as an ACK for packet N.
  61.  
  62. I have enclosed a copy of the modified routine; I would appreciate your
  63. checking my fix. I have also forwarded a copy of this to Columbia University.
  64.  
  65. Initially, we had trouble with the standard setting of the start-of-packet
  66. character, viz. Ctrl-A. Time and again, the TMP choked on one of these charac-
  67. ters and thus broke a file transfer. This happened in particular when the Mod-
  68. comp was heavily loaded and hence slow in execution.
  69.  
  70. As for as I can see, these interceptions must have occurred in the brief period
  71. between issuing a TERMIN and starting the next quick-return READ4 in function
  72. GETLIN. It seems there may be a fix for this problem: if you assign two UFTs to
  73. the input channel, say, whith IUFT pointers UFT1 and UFT2, you may start a new
  74. READ4 before TERMINating the old one, leaving no gap for the TMP to grab a
  75. CTRL-A:
  76. line 218: CALL READ4 (IUFT (1,UFT2), BLIN (1,2), 132, .FALSE.)
  77. line 219: CALL TERMIN (IUFT (1,UFT1))
  78. and lines 232-3 changed accordingly.
  79.  
  80. Of course, our problems immediately ceased when we changed the start-of-packet
  81. character to ACCII-30 - we are completely happy now; but the fix above would
  82. remove the necessity for setting up Max IV Kermit (and the Kermits that talk to
  83. it) to some non-standard start-of-packet. Again, I would appreciate your com-
  84. ments on this.
  85.  
  86. As a last point, you are using an assembler routine, POSUSL, to position to an
  87. entry within a USL. Obviously, this ist not for speed nor for any other bene-
  88. fit; hence, I have locally replaced this routine by a standard Fortran IV rou-
  89. tine written by one of my colleagues, Mr. Rolf Schmidt. Now, all the Kermit
  90. subroutines are compiled exactly the same way - no more special cases. While
  91. this is only an aesthetic progress, I nevertheless enclose a copy-feel free to
  92. use it, or discard it.
  93.  
  94. If there have been any updates on Kermit 1.0, please, let me know; I am in
  95. touch with Columbia University, but I have no idea if they are in close
  96. connection with you...
  97.  
  98. Regards,
  99.  
  100. Gisbert W. Selke
  101.  
  102.  
  103. ---------------------- SDATA -------------------------------------------------
  104.       INTEGER FUNCTION SDATA (X)
  105. C
  106. C     ****************************************************************
  107. C
  108. C              KERMIT for the MODCOMP MAXIV operating system
  109. C
  110. C        Compliments of:
  111. C
  112. C                         SETPOINT, Inc.
  113. C                      10245 Brecksville Rd.
  114. C                      Brecksville, Ohio 44141
  115. C
  116. C
  117. C      KERMIT is a copyrighted protocol of Columbia Univ. The authors
  118. C      of this version hereby grant permission to copy this software
  119. C      provided that it is not used for an explicitly commercial
  120. C      purpose and that proper credit be given. SETPOINT, Inc. makes
  121. C      no warranty whatsoever regarding the accuracy of this package
  122. C      and will assume no liability resulting from it's use.
  123. C
  124. C     ****************************************************************
  125. C
  126. C     Abstract:  Send a data packet to the remote Kermit.
  127. C
  128. C     MODIFICATION HISTORY
  129. C
  130. C     BY            DATE     REASON            PROGRAMS AFFECTED
  131. C    G.W.SELKE    13 MAY 88  WRONG TREATMENT OF NAK(N+1)   NONE
  132. C
  133. C     ****************************************************************
  134. C
  135. C     Author:  Rick Burke           Version: A.0    Date: Sep-86
  136. C
  137. C     Calling Parameters:
  138. C
  139. C     R    X            - Dummy argument required by FORTRAN
  140. C
  141. C     ****************************************************************
  142. C
  143. C     Messages generated by this module :  None
  144. C
  145. C     ****************************************************************
  146. C
  147. C     Subroutines called directly : BUFILL, MOD, RPACK, SPACK
  148. C
  149. C     ****************************************************************
  150. C
  151. C     Files referenced :  None
  152. C
  153. C     ****************************************************************
  154. C
  155. C     Local variable definitions :
  156. C
  157. C     LEN          - Length of received packet
  158. C     NUM          - Number of received packet
  159. C     TNUM         - Expected packet number
  160. C     TV1          - Temporary variable
  161. C
  162. C     ****************************************************************
  163. C
  164. C     Commons referenced :  KER and  KERPAR local commons
  165. C
  166. C     ****************************************************************
  167. C
  168. C     (*$END.DOCUMENT*)
  169. C
  170. C     ****************************************************************
  171. C     *                                                              *
  172. C     *         D I M E N S I O N   S T A T E M E N T S              *
  173. C     *                                                              *
  174. C     ****************************************************************
  175. C
  176.       IMPLICIT INTEGER (A-Z)
  177. C
  178. C     ****************************************************************
  179. C     *                                                              *
  180. C     *         T Y P E   S T A T E M E N T S                        *
  181. C     *                                                              *
  182. C     ****************************************************************
  183. C
  184. C
  185. C     ****************************************************************
  186. C     *                                                              *
  187. C     *         C O M M O N   S T A T E M E N T S                    *
  188. C     *                                                              *
  189. C     ****************************************************************
  190. C
  191.       INCLUDE USL/KERCOM
  192.       INCLUDE USL/KERPMC
  193. C
  194. C     ****************************************************************
  195. C     *                                                              *
  196. C     *         E Q U I V A L E N C E   S T A T E M E N T S          *
  197. C     *                                                              *
  198. C     ****************************************************************
  199. C
  200. C
  201. C     ****************************************************************
  202. C     *                                                              *
  203. C     *         D A T A   S T A T E M E N T S                        *
  204. C     *                                                              *
  205. C     ****************************************************************
  206. C
  207. C
  208. C     ****************************************************************
  209. C
  210. C     Code starts here :
  211. C
  212. C
  213. C----->  Assume some kind of error.
  214. C
  215.       SDATA = BIGA
  216. C
  217. C----->  Retry counter exceeded?
  218. C
  219.       IF (NUMTRY .GT. MAXTRY) RETURN
  220.       NUMTRY = NUMTRY + 1
  221. C
  222. C----->  Send the data packet.
  223. C
  224.       TNUM = N
  225.       TV1 = BIGD
  226.       CALL SPACK (TV1,TNUM,SIZE,PACKET)
  227. C
  228. C----->  If we are in local mode then display the packet
  229. C----->  sequence number.
  230. C
  231.       IF (HOSTON .EQ. NO) WRITE (LOCALO,100) TNUM
  232. C
  233. C----->  Get the reply from the remote.
  234. C
  235.       STATUS = RPACK (LEN,NUM,RECPKT)
  236. C
  237. C----->  The next statements are to make sure that we are not one
  238. C----->  packet ahead of the other Kermit. This will happen if the
  239. C----->  other Kermit sends a NAK (due to a timeout detection)
  240. C----->  before we send the first SINIT packet.
  241. C
  242.       IF (STATUS .EQ.  BIGY .AND.
  243.      >    N      .EQ. NUM+1      ) STATUS = RPACK (LEN,NUM,RECPKT)
  244.       IF (STATUS .NE. BIGN) GO TO 10
  245. C
  246. C----->  We got a NAK.
  247. C
  248. CCCCC IF (N .EQ. NUM-1) GO TO 50     ORIGINAL LINE, MODIFIED: GWS 13 MAY 1988
  249.       IF (N .EQ. NUM-1) GO TO 20
  250.       SDATA = STATE
  251.       RETURN
  252.    10 CONTINUE
  253.       IF (STATUS .NE. BIGY) GO TO 40
  254. C
  255. C----->  We got an ACK.
  256. C
  257.       IF (N .EQ. NUM) GO TO 20
  258. C
  259. C----->  But, it was for the last packet.
  260. C
  261.       SDATA = STATE
  262.       RETURN
  263.    20 CONTINUE
  264.       NUMTRY = 0
  265.       N = MOD((N+1),64)
  266.       SIZE = BUFILL (PACKET)
  267.       IF (SIZE .NE. EOF) GO TO 30
  268.       SDATA = BIGZ
  269.       RETURN
  270.    30 CONTINUE
  271.       SDATA = BIGD
  272.       RETURN
  273.    40 CONTINUE
  274.       IF (STATUS .NE. BAD) GO TO 50
  275. C
  276. C----->  We got a checksum error, try again.
  277. C
  278.       SDATA = STATE
  279.       RETURN
  280.    50 CONTINUE
  281. C
  282. C----->  Here we got an unknown packet type or an error occurred.
  283. C
  284.       RETURN
  285. 100   FORMAT('+PACKET #',I3,'  ')
  286.       END
  287. ----------------------- end of sdata ------------------------------------------
  288.  
  289. --------------------------- posusl --------------------------------------------
  290.  
  291.       SUBROUTINE POSUSL (FILNUM, MEMBER, FOUND)
  292. C
  293. C     ****************************************************************
  294. C
  295. C              KERMIT for the MODCOMP MAXIV operating system
  296. C
  297. C        This routine compliments of:
  298. C
  299. C         Wissenschaftliches Institut der Ortskrankenkassen (WIdO)
  300. C                        Kortrijker Strasse 1
  301. C                            D-5300 Bonn 1
  302. C                             West Germany
  303. C
  304. C
  305. C      KERMIT is a copyrighted protocol of Columbia Univ. The authors
  306. C      of this version hereby grant permission to copy this software
  307. C      provided that it is not used for an explicitly commercial
  308. C      purpose and that proper credit be given. SETPOINT, Inc. makes
  309. C      no warranty whatsoever regarding the accuracy of this package
  310. C      and will assume no liability resulting from it's use.
  311. C      Neither does the WIdO.
  312. C
  313. C     ****************************************************************
  314. C
  315. C     Abstract: Position a FORTRAN file to a SED directory entry.
  316. C
  317. C     MODIFICATION HISTORY
  318. C
  319. C     BY            DATE     REASON            PROGRAMS AFFECTED
  320. C     G.W.Selke     Feb-88   Positioning bug
  321. C
  322. C     ****************************************************************
  323. C
  324. C     Authors: Rolf Schmidt         Version:  A.1   Date: Sep-87
  325. C              Gisbert W.Selke
  326. C
  327. C     Calling Parameters:
  328. C
  329. C     FILNUM       - integer FORTRAN file number to be positioned
  330. C                    If FILNUM < 1600 it is assumed to be a FORTRAN
  331. C                    logical unit number; if >= 1600 it is assumed
  332. C                    to be the CAN code of the logical device name
  333. C
  334. C     MEMBER       - 8 character member name
  335. C
  336. C     FOUND        - logical status of positioning:
  337. C                    .TRUE.  = successful
  338. C                    .FALSE. = error condition
  339. C
  340. C
  341. C     ****************************************************************
  342. C
  343. C     Messages generated by this module :  None
  344. C
  345. C     ****************************************************************
  346. C
  347. C     Subroutines called directly :  BLDUFT, IACAN4, ICAN4, READ4, UPPER
  348. C
  349. C     ****************************************************************
  350. C
  351. C     Files referenced :  None
  352. C
  353. C     ****************************************************************
  354. C
  355. C     Local variable definitions :
  356. C
  357. C     BUF       - buffer for SED directory entries
  358. C     CHAIN     - pointer to next directory entry
  359. C     CONTRL    - type of directory entry
  360. C     ENTRY     - CAN coded directory entry name found
  361. C     EXTOPT    - extended option word for USL UFT
  362. C     FEFE      - directory entry type for proper entries
  363. C     FFFF      - directory entry type of first entry
  364. C     FIRST     - .TRUE. before reading first directory entry
  365. C     FPI       - file position index
  366. C     I         - index
  367. C     LFN       - CAN coded logical file name
  368. C     OPTION    - option word for USL UFT
  369. C     POS       - index into BUF
  370. C     RECLEN    - record length to be read (in words)
  371. C     USLNAM    - CAN coded name of entry to be found
  372. C
  373. C     ****************************************************************
  374. C
  375. C     Commons referenced :  KERCOM, KERPMC
  376. C
  377. C     ****************************************************************
  378. C
  379. C     (*$END.DOCUMENT*)
  380. C
  381. C     ****************************************************************
  382. C     *                                                              *
  383. C     *         D I M E N S I O N   S T A T E M E N T S              *
  384. C     *                                                              *
  385. C     ****************************************************************
  386. C
  387.       IMPLICIT INTEGER (A-Z)
  388. C
  389.       INTEGER*2 ENTRY(9), MEMBER(4), USLNAM(3), UFT(10), BUF(128)
  390. C
  391. C     ****************************************************************
  392. C     *                                                              *
  393. C     *         T Y P E   S T A T E M E N T S                        *
  394. C     *                                                              *
  395. C     ****************************************************************
  396. C
  397.       INTEGER*4 FPI
  398.       LOGICAL*2 FOUND, FIRST
  399. C
  400. C     ****************************************************************
  401. C     *                                                              *
  402. C     *         C O M M O N   S T A T E M E N T S                    *
  403. C     *                                                              *
  404. C     ****************************************************************
  405. C
  406.       INCLUDE USL/KERPMC
  407.       INCLUDE USL/KERCOM
  408. C
  409. C     ****************************************************************
  410. C     *                                                              *
  411. C     *         E Q U I V A L E N C E   S T A T E M E N T S          *
  412. C     *                                                              *
  413. C     ****************************************************************
  414. C
  415.       EQUIVALENCE (CONTRL,BUF(1))
  416.       EQUIVALENCE (CHAIN,BUF(2))
  417. C
  418. C     ****************************************************************
  419. C     *                                                              *
  420. C     *         D A T A   S T A T E M E N T S                        *
  421. C     *                                                              *
  422. C     ****************************************************************
  423. C
  424.       DATA OPTION/ZB600/, EXTOPT/Z4800/, FEFE/4ZFEFE/, FFFF/4ZFFFF/,
  425.      *     RBYTE/4Z00FF/
  426. C
  427. C     ****************************************************************
  428. C
  429. C     Code starts here :
  430. C
  431. C --- INITIALIZE UFT:
  432.       LFN = FILNUM
  433.       IF (LFN.LT.1600) LFN = ICAN4(LFN)
  434.       FPI = 0
  435.       CALL BLDUFT(UFT,0,LFN,OPTION,IADR(FPI),0,0,EXTOPT)
  436. C --- BUILD CAN CODE OF ENTRY NAME:
  437.       DO 5 I=1,4
  438.       ENTRY(I+I-1) = ISHFT(MEMBER(I),-8)
  439. 5     ENTRY(I+I)   = IAND(MEMBER(I),RBYTE)
  440.       ENTRY(9) = EOS
  441.       CALL UPPER(ENTRY,BUF)
  442.       DO 8 I=1,9
  443.       IF (BUF(I).EQ.LF .OR. BUF(I).EQ.EOS) BUF(I) = BLANK
  444.       IF ((BUF(I).GE.BIGA .AND. BUF(I).LE.BIGZ) .OR.
  445.      *    (BUF(I).GE.DIG0 .AND. BUF(I).LE.DIG9) .OR.
  446.      *    BUF(I).EQ. BLANK .OR. BUF(I).EQ.COLON .OR.
  447.      *    BUF(I).EQ.PERIOD .OR. BUF(I).EQ.DOLLAR)      GOTO 7
  448.       GOTO 140
  449. 7     CONTINUE
  450.       BUF(I) = ISHFT(BUF(I),8)
  451. 8     CONTINUE
  452.       DO 9 I=1,3
  453. 9     USLNAM(I) = IACAN4(BUF(3*I-2))
  454.       FOUND = .TRUE.
  455.       FIRST = .TRUE.
  456.       RECLEN = 128
  457. C --- LOOP THROUGH ALL DIRECTORY ENTRIES:
  458. 10    CONTINUE
  459.       IF (.NOT. FIRST) GOTO 35
  460. 20    CONTINUE
  461.       CALL READ4(UFT,BUF,256)
  462.       POS = 0
  463.       IF (.NOT. FIRST) GOTO 35
  464. C     FIRST DIRECTORY ENTRY:
  465.       IF (CONTRL .NE. FFFF ) GOTO 120
  466.       DO 30 I=1,9
  467.       POS = POS + 1
  468.       ENTRY(I) = BUF(POS+2)
  469. 30    CONTINUE
  470.       FIRST = .FALSE.
  471.       GOTO 10
  472. 35    CONTINUE
  473.       DO 38 I=1,9
  474.       POS = POS + 1
  475.       IF (POS .GT. 128) GOTO 50
  476.       ENTRY(I) = BUF(POS+2)
  477. 38    CONTINUE
  478.       IF (ENTRY(1) .NE. FEFE) GOTO 60
  479. C --- THIS WAS NOT A MEMBER-TYPE ENTRY:
  480.       RECLEN = ENTRY(4)
  481.       GOTO 10
  482. 50    CONTINUE
  483. C --- READ NEXT DIRECTORY SECTOR:
  484.       IF (CHAIN .EQ. FFFF ) GOTO 120
  485.       FPI = CHAIN
  486.       GOTO 20
  487. 60    CONTINUE
  488.       IF (ENTRY(1) .EQ. FFFF) GOTO 100
  489. C --- NOW WE GOT A MEMBER NAME; IS IT THE ONE WE LOOKED FOR?
  490.       DO 70 I=1,3
  491.       IF (ENTRY(I) .NE. USLNAM(I)) GOTO 10
  492. 70    CONTINUE
  493. C     GOT IT! NOW POSITION TO THE DATA:
  494.       FPI = ENTRY(7)-1
  495.       CALL READ4(UFT,I,1)
  496.       GOTO 900
  497. C
  498. 100   CONTINUE
  499. C --- MEMBER NOT IN USL:
  500.       FOUND=.FALSE.
  501.       GOTO 900
  502. 120   CONTINUE
  503. C --- ERROR IN DIRECTORY OR FILE IS NOT A USL:
  504.       FOUND=.FALSE.
  505.       GOTO 900
  506. 140   CONTINUE
  507. C --- NAME NOT CAN-CODEABLE:
  508.       WRITE (LOCALO,9143)
  509. 9143  FORMAT (' FILE NAME NOT CANCODEABLE')
  510.       FOUND = .FALSE.
  511. 900   CONTINUE
  512.       RETURN
  513.       END
  514. ------------------------------ end of posusl ----------------------------------
  515.  
  516.