Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/filesys_log.cpp

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

revision 5392 by yutakapon, Sun Sep 29 15:30:39 2013 UTC revision 5395 by yutakapon, Mon Sep 30 09:47:11 2013 UTC
# Line 442  BOOL LogStart() Line 442  BOOL LogStart()
442          unsigned tid;          unsigned tid;
443          DWORD ofs, size, written_size;          DWORD ofs, size, written_size;
444          char buf[512];          char buf[512];
445            const char *crlf = "\r\n";
446            DWORD crlf_len = 2;
447    
448          if ((FileLog) || (BinLog)) return FALSE;          if ((FileLog) || (BinLog)) return FALSE;
449    
# Line 641  BOOL LogStart() Line 643  BOOL LogStart()
643          // (2013.9.29 yutaka)          // (2013.9.29 yutaka)
644          if (ts.LogAllBuffIncludedInFirst) {          if (ts.LogAllBuffIncludedInFirst) {
645                  for (ofs = 0 ;  ; ofs++ ) {                  for (ofs = 0 ;  ; ofs++ ) {
646                            // 1つの行を取得する。文字だけなので、エスケープシーケンスは含まれない。
647                          size = BuffGetAnyLineData(ofs, buf, sizeof(buf));                          size = BuffGetAnyLineData(ofs, buf, sizeof(buf));
648                          if (size == -1)                          if (size == -1)
649                                  break;                                  break;
650                          WriteFile((HANDLE)LogVar->FileHandle, buf, size, &written_size, NULL);  
651                          WriteFile((HANDLE)LogVar->FileHandle, "\r\n", 2, &written_size, NULL);  #if 0
652                            if (ts.DeferredLogWriteMode) { // 遅延書き込み
653                                    char *pbuf = (char *)malloc(size + 2);
654                                    memcpy(pbuf, buf, size);
655                                    pbuf[size] = '\r';
656                                    pbuf[size+1] = '\n';
657                                    Sleep(1);  // スレッドキューが作られるように、コンテキストスイッチを促す。
658                                    PostThreadMessage(LogVar->LogThreadId, WM_DPC_LOGTHREAD_SEND, (WPARAM)pbuf, size + 2);
659                            } else { // 直書き。ネットワーク経由だと遅い。
660    #endif
661                                    WriteFile((HANDLE)LogVar->FileHandle, buf, size, &written_size, NULL);
662                                    WriteFile((HANDLE)LogVar->FileHandle, crlf, crlf_len, &written_size, NULL);
663    #if 0
664                            }
665    #endif
666                  }                  }
667          }          }
668    

Legend:
Removed from v.5392  
changed lines
  Added in v.5395

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