Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpcmn/ttcmn.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8896 by zmatsuo, Sat Jul 25 16:00:24 2020 UTC revision 8897 by zmatsuo, Tue Aug 18 15:27:54 2020 UTC
# Line 1346  int WINAPI CommReadRawByte(PComVar cv, L Line 1346  int WINAPI CommReadRawByte(PComVar cv, L
1346          }          }
1347  }  }
1348    
1349    static void LogBinSkip(PComVar cv, int add)
1350    {
1351            if (cv->LogBinSkip != NULL) {
1352                    cv->LogBinSkip(add);
1353            }
1354    }
1355    
1356  void WINAPI CommInsert1Byte(PComVar cv, BYTE b)  void WINAPI CommInsert1Byte(PComVar cv, BYTE b)
1357  {  {
1358          if ( ! cv->Ready ) {          if ( ! cv->Ready ) {
# Line 1361  void WINAPI CommInsert1Byte(PComVar cv, Line 1368  void WINAPI CommInsert1Byte(PComVar cv,
1368          cv->InBuff[cv->InPtr] = b;          cv->InBuff[cv->InPtr] = b;
1369          cv->InBuffCount++;          cv->InBuffCount++;
1370    
1371          if (cv->HBinBuf!=0 ) {          LogBinSkip(cv, 1);
                 cv->BinSkip++;  
         }  
1372  }  }
1373    
1374  void Log1Bin(PComVar cv, BYTE b)  static void Log1Bin(PComVar cv, BYTE b)
1375  {  {
1376          if (((cv->FilePause & OpLog)!=0) || cv->ProtoFlag) {          if (cv->Log1Bin != NULL) {
1377                  return;                  cv->Log1Bin(b);
         }  
         if (cv->BinSkip > 0) {  
                 cv->BinSkip--;  
                 return;  
         }  
         cv->BinBuf[cv->BinPtr] = b;  
         cv->BinPtr++;  
         if (cv->BinPtr>=InBuffSize) {  
                 cv->BinPtr = cv->BinPtr-InBuffSize;  
         }  
         if (cv->BCount>=InBuffSize) {  
                 cv->BCount = InBuffSize;  
                 cv->BStart = cv->BinPtr;  
         }  
         else {  
                 cv->BCount++;  
1378          }          }
1379  }  }
1380    
# Line 1397  int WINAPI CommRead1Byte(PComVar cv, LPB Line 1386  int WINAPI CommRead1Byte(PComVar cv, LPB
1386                  return 0;                  return 0;
1387          }          }
1388    
         if ((cv->HLogBuf!=NULL) && (cv->LCount>=InBuffSize-10)) {  
                 // 自分のバッファに余裕がない場合は、CPUスケジューリングを他に回し、  
                 // CPUがストールするの防ぐ。  
                 // (2006.10.13 yutaka)  
                 Sleep(1);  
                 return 0;  
         }  
   
         if ((cv->HBinBuf!=NULL) &&  
             (cv->BCount>=InBuffSize-10)) {  
                 return 0;  
         }  
   
1389          if ( cv->TelMode ) {          if ( cv->TelMode ) {
1390                  c = 0;                  c = 0;
1391          }          }
# Line 1430  int WINAPI CommRead1Byte(PComVar cv, LPB Line 1406  int WINAPI CommRead1Byte(PComVar cv, LPB
1406                          if ( *b != 0xFF ) {                          if ( *b != 0xFF ) {
1407                                  cv->TelMode = TRUE;                                  cv->TelMode = TRUE;
1408                                  CommInsert1Byte(cv,*b);                                  CommInsert1Byte(cv,*b);
1409                                  if ( cv->HBinBuf!=0 ) {                                  LogBinSkip(cv, -1);
                                         cv->BinSkip--;  
                                 }  
1410                                  c = 0;                                  c = 0;
1411                          }                          }
1412                  }                  }
# Line 1450  int WINAPI CommRead1Byte(PComVar cv, LPB Line 1424  int WINAPI CommRead1Byte(PComVar cv, LPB
1424                  }                  }
1425          }          }
1426    
1427          if ( (c==1) && (cv->HBinBuf!=0) ) {          if (c == 1) {
1428                  Log1Bin(cv, *b);                  Log1Bin(cv, *b);
1429          }          }
1430    

Legend:
Removed from v.8896  
changed lines
  Added in v.8897

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26