svnno****@sourc*****
svnno****@sourc*****
2010年 6月 23日 (水) 12:00:38 JST
Revision: 3932 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3932 Author: doda Date: 2010-06-23 12:00:38 +0900 (Wed, 23 Jun 2010) Log Message: ----------- 送信処理が重くなっていたのを修正。 http://sourceforge.jp/forum/message.php?msg_id=51234 Modified Paths: -------------- trunk/teraterm/common/tttypes.h trunk/teraterm/teraterm/commlib.c trunk/teraterm/teraterm/vtwin.cpp trunk/teraterm/ttpcmn/ttcmn.c -------------- next part -------------- Modified: trunk/teraterm/common/tttypes.h =================================================================== --- trunk/teraterm/common/tttypes.h 2010-06-22 16:28:47 UTC (rev 3931) +++ trunk/teraterm/common/tttypes.h 2010-06-23 03:00:38 UTC (rev 3932) @@ -3,6 +3,7 @@ All rights reserved. */ /* Constants and types for Tera Term */ +#include <locale.h> #define IdBreakTimer 1 #define IdDelayTimer 2 @@ -877,6 +878,7 @@ BOOL TelLineMode; int *pureutf8; + _locale_t locale; } TComVar; typedef TComVar far *PComVar; Modified: trunk/teraterm/teraterm/commlib.c =================================================================== --- trunk/teraterm/teraterm/commlib.c 2010-06-22 16:28:47 UTC (rev 3931) +++ trunk/teraterm/teraterm/commlib.c 2010-06-23 03:00:38 UTC (rev 3932) @@ -23,6 +23,7 @@ #include "WSAAsyncGetAddrInfo.h" #endif /* NO_INET6 */ #include <time.h> +#include <locale.h> static SOCKET OpenSocket(PComVar); static void AsyncConnect(PComVar); @@ -286,6 +287,7 @@ cv->TelCRSendEcho = FALSE; cv->TelAutoDetect = ts->TelAutoDetect; /* TTPLUG */ cv->Locale = ts->Locale; + cv->locale = _create_locale(LC_ALL, cv->Locale); cv->CodePage = &ts->CodePage; cv->ConnetingTimeout = &ts->ConnectingTimeout; cv->LastSendTime = time(NULL); @@ -766,6 +768,8 @@ } cv->ComID = INVALID_HANDLE_VALUE; cv->PortType = 0; + + _free_locale(cv->locale); } void CommProcRRQ(PComVar cv) Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2010-06-22 16:28:47 UTC (rev 3931) +++ trunk/teraterm/teraterm/vtwin.cpp 2010-06-23 03:00:38 UTC (rev 3932) @@ -1496,8 +1496,12 @@ cv.RussHost = ts.RussHost; cv.RussClient = ts.RussClient; - if (cv.Ready && cv.TelFlag && (ts.TelEcho>0)) { - TelChangeEcho(); + if (cv.Ready) { + if (cv.TelFlag && (ts.TelEcho>0)) { + TelChangeEcho(); + } + _free_locale(cv.locale); + cv.locale = _create_locale(LC_ALL, cv.Locale); } if ((ts.TerminalWidth!=NumOfColumns) || Modified: trunk/teraterm/ttpcmn/ttcmn.c =================================================================== --- trunk/teraterm/ttpcmn/ttcmn.c 2010-06-22 16:28:47 UTC (rev 3931) +++ trunk/teraterm/ttpcmn/ttcmn.c 2010-06-23 03:00:38 UTC (rev 3932) @@ -1227,10 +1227,7 @@ int SendCodeNew; BYTE d; BOOL Full, KanjiFlagNew; - _locale_t locale; - locale = _create_locale(LC_ALL, cv->Locale); - Full = FALSE; i = 0; while (! Full && (i < C)) { @@ -1274,7 +1271,7 @@ TempStr[TempLen++] = LOBYTE(K); } } - else if (_isleadbyte_l(d, locale)) { + else if (_isleadbyte_l(d, cv->locale)) { KanjiFlagNew = TRUE; cv->SendKanjiFirst = d; SendCodeNew = IdKanji; @@ -1430,8 +1427,6 @@ } // end of "while {}" - _free_locale(locale); - return i; } @@ -1592,10 +1587,7 @@ int EchoCodeNew; BYTE d; BOOL Full, KanjiFlagNew; - _locale_t locale; - locale = _create_locale(LC_ALL, cv->Locale); - Full = FALSE; i = 0; while (! Full && (i < C)) { @@ -1639,7 +1631,7 @@ TempStr[TempLen++] = LOBYTE(K); } } - else if (_isleadbyte_l(d, locale)) { + else if (_isleadbyte_l(d, cv->locale)) { KanjiFlagNew = TRUE; cv->EchoKanjiFirst = d; EchoCodeNew = IdKanji; @@ -1756,8 +1748,6 @@ } // end of "while {}" - _free_locale(locale); - return i; }