31-May-88 06:59:34-EDT,19391;000000000001 Return-Path: Received: from CUVMA.COLUMBIA.EDU by CU20B.COLUMBIA.EDU with TCP; Tue 31 May 88 06:59:29-EDT Received: from CUVMA.COLUMBIA.EDU(MAILER) by CUVMA.COLUMBIA.EDU(SMTP) ; Tue, 31 May 88 07:00:16 EDT Received: by CUVMA (Mailer X1.25) id 2820; Tue, 31 May 88 07:00:13 EDT Date: 05/31 06:05:39 From: FDCCU@CUVMA Subject: MODCMP BWR - PUN file from RSCS Tag: FILE (1754) ORIGIN DBNUAMA1 RECK 5/31/88 2:05:26 E.D.T. To: SY.FDC@CU20B Reply-To: RECK%DBNUAMA1.BITNET@CUVMA.COLUMBIA.EDU From: Gisbert W.Selke (RECK@DBNUAMA1.BITNET) Date: 27 May 1988 Re: Modcomp Kermit - a bug and two suggestions Frank, I'think I found a bug in Modcomp Kermit which sometimes caused it to crash a file transfer without necessity. I think I've fixed it, and I've written a letter to the authors for clearance. The letter is appended below, together with the fixed routine (SDATA). In addition, I think one can make Modcomp Kermit cope better with a particular Modcomp peculiarity (viz., using Ctrl-A as a signal to the terminal maintenance processor - the standard Kermit start of packet must be set to something different because every once in a while TMP saw a Ctrl-A before Kermit could grab it). One can do without this change; but I think it's worth it for the sake of conformity to the rest of the Kermit world. I'd like to hear suggestions from people more knowledgeable than myself, though, before I proceed and install this change. So if you see fit, this is a matter for discussion amongst Modcomp readers of info-kermit. Otherwise, at least the SDATA fix is of general interest, I think. \Gisbert ------------------------ letter ---------------------------------------------- Re Modcomp Max IV Kermit 1.0 - a bug fix and a suggestion Dear Mr. Burke, dear Mr. Borgeson, I have successfully installed vour Modcomp Max IV Kermit at our site. We are using version 1.0, and the sources are labeled A.0, September till October 86, mainly. It is a fine programme, and our users appreciate the reliability and robustness it displays in everyday usage. However, I am afraid there is a little bug somewhere down in function SDATA. This bug rears its ugly head on certain occasions when transferring a file from the Modcomp to a micro: if an ACK from the micro is lost and the micro times out, it may next send a NAK for the next packet - which the Modcomp Kermit has not sent yet, of course, since it is still waiting for the lost ACK. According to the Kermit book, if the Modcomp receives such a NAK for the next packet, this is to be interpreted as an implicit ACK for the current packet (cf. "Ker- mit-A File Transfer Protocol" by Frank da Cruz, Digital Press 1987, p. 217). This is violated by line 144 of SDATA: whenever RPACK returns a NAK, the line "IF (N.EQ.NUM-1) GO TO 50" forces SDATA to return, while line 111 has set the return code to BIGA, i. e. "Abort due to some error". The correct behaviour seems to me to branch to label 20 instead of label 50, i. e. accept the NAK for packet N+1 as an ACK for packet N. I have enclosed a copy of the modified routine; I would appreciate your checking my fix. I have also forwarded a copy of this to Columbia University. Initially, we had trouble with the standard setting of the start-of-packet character, viz. Ctrl-A. Time and again, the TMP choked on one of these charac- ters and thus broke a file transfer. This happened in particular when the Mod- comp was heavily loaded and hence slow in execution. As for as I can see, these interceptions must have occurred in the brief period between issuing a TERMIN and starting the next quick-return READ4 in function GETLIN. It seems there may be a fix for this problem: if you assign two UFTs to the input channel, say, whith IUFT pointers UFT1 and UFT2, you may start a new READ4 before TERMINating the old one, leaving no gap for the TMP to grab a CTRL-A: line 218: CALL READ4 (IUFT (1,UFT2), BLIN (1,2), 132, .FALSE.) line 219: CALL TERMIN (IUFT (1,UFT1)) and lines 232-3 changed accordingly. Of course, our problems immediately ceased when we changed the start-of-packet character to ACCII-30 - we are completely happy now; but the fix above would remove the necessity for setting up Max IV Kermit (and the Kermits that talk to it) to some non-standard start-of-packet. Again, I would appreciate your com- ments on this. As a last point, you are using an assembler routine, POSUSL, to position to an entry within a USL. Obviously, this ist not for speed nor for any other bene- fit; hence, I have locally replaced this routine by a standard Fortran IV rou- tine written by one of my colleagues, Mr. Rolf Schmidt. Now, all the Kermit subroutines are compiled exactly the same way - no more special cases. While this is only an aesthetic progress, I nevertheless enclose a copy-feel free to use it, or discard it. If there have been any updates on Kermit 1.0, please, let me know; I am in touch with Columbia University, but I have no idea if they are in close connection with you... Regards, Gisbert W. Selke ---------------------- SDATA ------------------------------------------------- INTEGER FUNCTION SDATA (X) C C **************************************************************** C C KERMIT for the MODCOMP MAXIV operating system C C Compliments of: C C SETPOINT, Inc. C 10245 Brecksville Rd. C Brecksville, Ohio 44141 C C C KERMIT is a copyrighted protocol of Columbia Univ. The authors C of this version hereby grant permission to copy this software C provided that it is not used for an explicitly commercial C purpose and that proper credit be given. SETPOINT, Inc. makes C no warranty whatsoever regarding the accuracy of this package C and will assume no liability resulting from it's use. C C **************************************************************** C C Abstract: Send a data packet to the remote Kermit. C C MODIFICATION HISTORY C C BY DATE REASON PROGRAMS AFFECTED C G.W.SELKE 13 MAY 88 WRONG TREATMENT OF NAK(N+1) NONE C C **************************************************************** C C Author: Rick Burke Version: A.0 Date: Sep-86 C C Calling Parameters: C C R X - Dummy argument required by FORTRAN C C **************************************************************** C C Messages generated by this module : None C C **************************************************************** C C Subroutines called directly : BUFILL, MOD, RPACK, SPACK C C **************************************************************** C C Files referenced : None C C **************************************************************** C C Local variable definitions : C C LEN - Length of received packet C NUM - Number of received packet C TNUM - Expected packet number C TV1 - Temporary variable C C **************************************************************** C C Commons referenced : KER and KERPAR local commons C C **************************************************************** C C (*$END.DOCUMENT*) C C **************************************************************** C * * C * D I M E N S I O N S T A T E M E N T S * C * * C **************************************************************** C IMPLICIT INTEGER (A-Z) C C **************************************************************** C * * C * T Y P E S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C * * C * C O M M O N S T A T E M E N T S * C * * C **************************************************************** C INCLUDE USL/KERCOM INCLUDE USL/KERPMC C C **************************************************************** C * * C * E Q U I V A L E N C E S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C * * C * D A T A S T A T E M E N T S * C * * C **************************************************************** C C C **************************************************************** C C Code starts here : C C C-----> Assume some kind of error. C SDATA = BIGA C C-----> Retry counter exceeded? C IF (NUMTRY .GT. MAXTRY) RETURN NUMTRY = NUMTRY + 1 C C-----> Send the data packet. C TNUM = N TV1 = BIGD CALL SPACK (TV1,TNUM,SIZE,PACKET) C C-----> If we are in local mode then display the packet C-----> sequence number. C IF (HOSTON .EQ. NO) WRITE (LOCALO,100) TNUM C C-----> Get the reply from the remote. C STATUS = RPACK (LEN,NUM,RECPKT) C C-----> The next statements are to make sure that we are not one C-----> packet ahead of the other Kermit. This will happen if the C-----> other Kermit sends a NAK (due to a timeout detection) C-----> before we send the first SINIT packet. C IF (STATUS .EQ. BIGY .AND. > N .EQ. NUM+1 ) STATUS = RPACK (LEN,NUM,RECPKT) IF (STATUS .NE. BIGN) GO TO 10 C C-----> We got a NAK. C CCCCC IF (N .EQ. NUM-1) GO TO 50 ORIGINAL LINE, MODIFIED: GWS 13 MAY 1988 IF (N .EQ. NUM-1) GO TO 20 SDATA = STATE RETURN 10 CONTINUE IF (STATUS .NE. BIGY) GO TO 40 C C-----> We got an ACK. C IF (N .EQ. NUM) GO TO 20 C C-----> But, it was for the last packet. C SDATA = STATE RETURN 20 CONTINUE NUMTRY = 0 N = MOD((N+1),64) SIZE = BUFILL (PACKET) IF (SIZE .NE. EOF) GO TO 30 SDATA = BIGZ RETURN 30 CONTINUE SDATA = BIGD RETURN 40 CONTINUE IF (STATUS .NE. BAD) GO TO 50 C C-----> We got a checksum error, try again. C SDATA = STATE RETURN 50 CONTINUE C C-----> Here we got an unknown packet type or an error occurred. C RETURN 100 FORMAT('+PACKET #',I3,' ') END ----------------------- end of sdata ------------------------------------------ --------------------------- posusl -------------------------------------------- SUBROUTINE POSUSL (FILNUM, MEMBER, FOUND) C C **************************************************************** C C KERMIT for the MODCOMP MAXIV operating system C C This routine compliments of: C C Wissenschaftliches Institut der Ortskrankenkassen (WIdO) C Kortrijker Strasse 1 C D-5300 Bonn 1 C West Germany C C C KERMIT is a copyrighted protocol of Columbia Univ. The authors C of this version hereby grant permission to copy this software C provided that it is not used for an explicitly commercial C purpose and that proper credit be given. SETPOINT, Inc. makes C no warranty whatsoever regarding the accuracy of this package C and will assume no liability resulting from it's use. C Neither does the WIdO. C C **************************************************************** C C Abstract: Position a FORTRAN file to a SED directory entry. C C MODIFICATION HISTORY C C BY DATE REASON PROGRAMS AFFECTED C G.W.Selke Feb-88 Positioning bug C C **************************************************************** C C Authors: Rolf Schmidt Version: A.1 Date: Sep-87 C Gisbert W.Selke C C Calling Parameters: C C FILNUM - integer FORTRAN file number to be positioned C If FILNUM < 1600 it is assumed to be a FORTRAN C logical unit number; if >= 1600 it is assumed C to be the CAN code of the logical device name C C MEMBER - 8 character member name C C FOUND - logical status of positioning: C .TRUE. = successful C .FALSE. = error condition C C C **************************************************************** C C Messages generated by this module : None C C **************************************************************** C C Subroutines called directly : BLDUFT, IACAN4, ICAN4, READ4, UPPER C C **************************************************************** C C Files referenced : None C C **************************************************************** C C Local variable definitions : C C BUF - buffer for SED directory entries C CHAIN - pointer to next directory entry C CONTRL - type of directory entry C ENTRY - CAN coded directory entry name found C EXTOPT - extended option word for USL UFT C FEFE - directory entry type for proper entries C FFFF - directory entry type of first entry C FIRST - .TRUE. before reading first directory entry C FPI - file position index C I - index C LFN - CAN coded logical file name C OPTION - option word for USL UFT C POS - index into BUF C RECLEN - record length to be read (in words) C USLNAM - CAN coded name of entry to be found C C **************************************************************** C C Commons referenced : KERCOM, KERPMC C C **************************************************************** C C (*$END.DOCUMENT*) C C **************************************************************** C * * C * D I M E N S I O N S T A T E M E N T S * C * * C **************************************************************** C IMPLICIT INTEGER (A-Z) C INTEGER*2 ENTRY(9), MEMBER(4), USLNAM(3), UFT(10), BUF(128) C C **************************************************************** C * * C * T Y P E S T A T E M E N T S * C * * C **************************************************************** C INTEGER*4 FPI LOGICAL*2 FOUND, FIRST C C **************************************************************** C * * C * C O M M O N S T A T E M E N T S * C * * C **************************************************************** C INCLUDE USL/KERPMC INCLUDE USL/KERCOM C C **************************************************************** C * * C * E Q U I V A L E N C E S T A T E M E N T S * C * * C **************************************************************** C EQUIVALENCE (CONTRL,BUF(1)) EQUIVALENCE (CHAIN,BUF(2)) C C **************************************************************** C * * C * D A T A S T A T E M E N T S * C * * C **************************************************************** C DATA OPTION/ZB600/, EXTOPT/Z4800/, FEFE/4ZFEFE/, FFFF/4ZFFFF/, * RBYTE/4Z00FF/ C C **************************************************************** C C Code starts here : C C --- INITIALIZE UFT: LFN = FILNUM IF (LFN.LT.1600) LFN = ICAN4(LFN) FPI = 0 CALL BLDUFT(UFT,0,LFN,OPTION,IADR(FPI),0,0,EXTOPT) C --- BUILD CAN CODE OF ENTRY NAME: DO 5 I=1,4 ENTRY(I+I-1) = ISHFT(MEMBER(I),-8) 5 ENTRY(I+I) = IAND(MEMBER(I),RBYTE) ENTRY(9) = EOS CALL UPPER(ENTRY,BUF) DO 8 I=1,9 IF (BUF(I).EQ.LF .OR. BUF(I).EQ.EOS) BUF(I) = BLANK IF ((BUF(I).GE.BIGA .AND. BUF(I).LE.BIGZ) .OR. * (BUF(I).GE.DIG0 .AND. BUF(I).LE.DIG9) .OR. * BUF(I).EQ. BLANK .OR. BUF(I).EQ.COLON .OR. * BUF(I).EQ.PERIOD .OR. BUF(I).EQ.DOLLAR) GOTO 7 GOTO 140 7 CONTINUE BUF(I) = ISHFT(BUF(I),8) 8 CONTINUE DO 9 I=1,3 9 USLNAM(I) = IACAN4(BUF(3*I-2)) FOUND = .TRUE. FIRST = .TRUE. RECLEN = 128 C --- LOOP THROUGH ALL DIRECTORY ENTRIES: 10 CONTINUE IF (.NOT. FIRST) GOTO 35 20 CONTINUE CALL READ4(UFT,BUF,256) POS = 0 IF (.NOT. FIRST) GOTO 35 C FIRST DIRECTORY ENTRY: IF (CONTRL .NE. FFFF ) GOTO 120 DO 30 I=1,9 POS = POS + 1 ENTRY(I) = BUF(POS+2) 30 CONTINUE FIRST = .FALSE. GOTO 10 35 CONTINUE DO 38 I=1,9 POS = POS + 1 IF (POS .GT. 128) GOTO 50 ENTRY(I) = BUF(POS+2) 38 CONTINUE IF (ENTRY(1) .NE. FEFE) GOTO 60 C --- THIS WAS NOT A MEMBER-TYPE ENTRY: RECLEN = ENTRY(4) GOTO 10 50 CONTINUE C --- READ NEXT DIRECTORY SECTOR: IF (CHAIN .EQ. FFFF ) GOTO 120 FPI = CHAIN GOTO 20 60 CONTINUE IF (ENTRY(1) .EQ. FFFF) GOTO 100 C --- NOW WE GOT A MEMBER NAME; IS IT THE ONE WE LOOKED FOR? DO 70 I=1,3 IF (ENTRY(I) .NE. USLNAM(I)) GOTO 10 70 CONTINUE C GOT IT! NOW POSITION TO THE DATA: FPI = ENTRY(7)-1 CALL READ4(UFT,I,1) GOTO 900 C 100 CONTINUE C --- MEMBER NOT IN USL: FOUND=.FALSE. GOTO 900 120 CONTINUE C --- ERROR IN DIRECTORY OR FILE IS NOT A USL: FOUND=.FALSE. GOTO 900 140 CONTINUE C --- NAME NOT CAN-CODEABLE: WRITE (LOCALO,9143) 9143 FORMAT (' FILE NAME NOT CANCODEABLE') FOUND = .FALSE. 900 CONTINUE RETURN END ------------------------------ end of posusl ----------------------------------