Index: teraterm/ttpfile/kermit.c =================================================================== --- teraterm/ttpfile/kermit.c (revision 10174) +++ teraterm/ttpfile/kermit.c (working copy) @@ -137,12 +137,13 @@ static BYTE KmtNum(BYTE b); -static void KmtOutputCommonLog(PFileVarProto fv, PKmtVar kv, BYTE *buf, int len) +static void KmtOutputCommonLog(PFileVarProto fv, PKmtVar kv, BYTE *buf, int len, BOOL send) { TProtoLog* log = kv->log; int i, datalen, n; char str[128]; char type, *s; + BYTE chkt; for (i = 0 ; i < len ; i++) log->DumpByte(log, buf[i]); @@ -185,10 +186,16 @@ default: s = "UNKNOWN"; break; } n = KmtNum(buf[1]); + if (send) { + chkt = kv->KmtMy.CHKT; + } + else{ + chkt = kv->KmtYour.CHKT; + } if (n >= 3) - datalen = n - 2 - kv->KmtMy.CHKT; + datalen = n - 2 - chkt; else - datalen = KmtNum(buf[4])*95 + KmtNum(buf[5]) - kv->KmtMy.CHKT; + datalen = KmtNum(buf[4])*95 + KmtNum(buf[5]) - chkt; _snprintf_s(str, sizeof(str), _TRUNCATE, "MARK=%x LEN=%d SEQ#=%d TYPE=%s DATA_LEN=%d\n", buf[0], n, KmtNum(buf[2]), s, datalen); @@ -247,7 +254,7 @@ { TProtoLog* log = kv->log; log->WriteRaw(log, "\015\012<<<\015\012",7); - KmtOutputCommonLog(fv, kv, buf, len); + KmtOutputCommonLog(fv, kv, buf, len, FALSE); } } @@ -257,7 +264,7 @@ { TProtoLog* log = kv->log; log->WriteRaw(log, "\015\012>>>\015\012",7); - KmtOutputCommonLog(fv, kv, buf, len); + KmtOutputCommonLog(fv, kv, buf, len, TRUE); } } @@ -463,10 +470,10 @@ Sum = KmtCheckSumType1(&kv->PktIn[1], 5); if ((BYTE)Sum != kv->PktIn[6]) return FALSE; - len = kv->PktInCount - 1 - kv->KmtMy.CHKT; + len = kv->PktInCount - 1 - kv->KmtYour.CHKT; } else { - len = kv->PktInLen+1-kv->KmtMy.CHKT; + len = kv->PktInLen + 1 - kv->KmtYour.CHKT; } @@ -476,9 +483,9 @@ Sum = Sum + kv->PktIn[i]; /* Calc CHECK */ - KmtCalcCheck(Sum, kv->KmtMy.CHKT, &Check[0]); + KmtCalcCheck(Sum, kv->KmtYour.CHKT, &Check[0]); - for (i = 1 ; i <= kv->KmtMy.CHKT ; i++) + for (i = 1 ; i <= kv->KmtYour.CHKT ; i++) if (Check[i-1] != kv->PktIn[ len + i ]) return FALSE; @@ -498,11 +505,11 @@ BYTE b, n; if (kv->PktInLen == 0) { /* Long Packet */ - NParam = kv->PktInLongPacketLen - kv->KmtMy.CHKT; + NParam = kv->PktInLongPacketLen - kv->KmtYour.CHKT; off = LONGPKT_HEADNUM; } else { - NParam = kv->PktInLen - 2 - kv->KmtMy.CHKT; + NParam = kv->PktInLen - 2 - kv->KmtYour.CHKT; off = HEADNUM; } @@ -649,10 +656,10 @@ BuffPtr = 0; if (kv->PktInLen == 0) { /* Long Packet */ - DataLen = kv->PktInLongPacketLen - kv->KmtMy.CHKT; + DataLen = kv->PktInLongPacketLen - kv->KmtYour.CHKT; off = 6; } else { - DataLen = kv->PktInLen - kv->KmtMy.CHKT - 2; + DataLen = kv->PktInLen - kv->KmtYour.CHKT - 2; off = 3; } @@ -724,10 +731,10 @@ struct tm tm; if (kv->PktInLen == 0) { /* Long Packet */ - DataLen = kv->PktInLongPacketLen - kv->KmtMy.CHKT; + DataLen = kv->PktInLongPacketLen - kv->KmtYour.CHKT; off = 6; } else { - DataLen = kv->PktInLen - kv->KmtMy.CHKT - 2; + DataLen = kv->PktInLen - kv->KmtYour.CHKT - 2; off = 3; }