Revision: 7950 https://osdn.net/projects/ttssh2/scm/svn/commits/7950 Author: yutakapon Date: 2019-08-14 00:09:07 +0900 (Wed, 14 Aug 2019) Log Message: ----------- SCPファイル受信中、リストが上限閾値を超えた場合、recvを呼び出さないようにした。 #34056 Ticket Links: ------------ https://osdn.net/projects/ttssh2/tracker/detail/34056 Modified Paths: -------------- branches/scp_flowctrl/ttssh2/ttxssh/pkt.c branches/scp_flowctrl/ttssh2/ttxssh/ssh.c branches/scp_flowctrl/ttssh2/ttxssh/ssh.h -------------- next part -------------- Modified: branches/scp_flowctrl/ttssh2/ttxssh/pkt.c =================================================================== --- branches/scp_flowctrl/ttssh2/ttxssh/pkt.c 2019-08-13 13:38:22 UTC (rev 7949) +++ branches/scp_flowctrl/ttssh2/ttxssh/pkt.c 2019-08-13 15:09:07 UTC (rev 7950) @@ -267,8 +267,17 @@ // \x83p\x83P\x83b\x83g\x82̎\xF3\x90M int amount_read; - amount_read = recv_data(pvar, READAMOUNT); + // SCP\x83t\x83@\x83C\x83\x8B\x8E\xF3\x90M\x8F\x88\x97\x9D\x82\xF0\x88ꎞ\x92\xE2\x8E~\x92\x86\x82Ȃ\xE7\x82Arecv()\x82\xF0\x82\xB5\x82Ȃ\xA2\x81B + if (pvar->recv_suspended) { + // \x82\xBB\x82\xEA\x82܂łɎ\xF3\x90M\x82\xB5\x82\xBD\x83f\x81[\x83^\x83T\x83C\x83Y\x82\xF0Tera Term\x91\xA4\x82ɕԂ\xB7\x81B + return amount_in_buf; + } + else { + amount_read = recv_data(pvar, READAMOUNT); + + } + if (amount_read == SOCKET_ERROR) { if (amount_in_buf == 0) { return SOCKET_ERROR; Modified: branches/scp_flowctrl/ttssh2/ttxssh/ssh.c =================================================================== --- branches/scp_flowctrl/ttssh2/ttxssh/ssh.c 2019-08-13 13:38:22 UTC (rev 7949) +++ branches/scp_flowctrl/ttssh2/ttxssh/ssh.c 2019-08-13 15:09:07 UTC (rev 7950) @@ -8558,6 +8558,10 @@ ShowWindow(c->scp.progress_window, SW_HIDE); cancel_abort: + // SCP\x82̎\xF3\x90M\x8F\x88\x97\x9D\x82\xAA\x8FI\x97\xB9\x82\xB5\x82\xBD\x8Fꍇ\x82́Arecv()\x82̃u\x83\x8D\x83b\x83N\x82\xF0\x89\xF0\x8F\x9C\x82\xB7\x82\xE9\x81B + // \x82\xB1\x82\xEA\x82\xF0\x82\xE2\x82\xE7\x82Ȃ\xA2\x82ƁATera Term\x82\xAA\x8Cł܂\xC1\x82\xBD\x82܂܂ɂȂ\xC1\x82Ă\xB5\x82܂\xA4\x81B + pvar->recv_suspended = FALSE; + // \x83`\x83\x83\x83l\x83\x8B\x82̃N\x83\x8D\x81[\x83Y\x82\xF0\x8Ds\x82\xA2\x82\xBD\x82\xA2\x82\xAA\x81A\x92\xBC\x90\xDA ssh2_channel_send_close() \x82\xF0\x8CĂяo\x82\xB7\x82ƁA // \x93\x96\x8AY\x8A\x94\x82\xAA\x83X\x83\x8C\x83b\x83h\x83Z\x81[\x83t\x82ł͂Ȃ\xA2\x82\xBD\x82߁ASCP\x8F\x88\x97\x9D\x82\xAA\x90\xB3\x8F\xED\x82ɏI\x97\xB9\x82\xB5\x82Ȃ\xA2\x8Fꍇ\x82\xAA\x82\xA0\x82\xE9\x81B // (2011.6.1 yutaka) @@ -8647,7 +8651,12 @@ // \x83L\x83\x85\x81[\x82ɋl\x82f\x81[\x83^\x82̑\x8D\x83T\x83C\x83Y\x82\xAA\x89\xBA\x8C\xC0臒l\x82\xF0\x89\xBA\x89\xF1\x82\xC1\x82\xBD\x8Fꍇ\x81A // SSH\x83T\x81[\x83o\x82\xA9\x82\xE7\x82̎\xF3\x90M\x82\xF0\x8DĊJ\x82\xB7\x82\xE9\x82悤\x82Ɏw\x8E\xA6\x82\xF0\x8Fo\x82\xB7\x81B if (c->scp.pktlist_cursize <= SCPRCV_LOW_WATER_MARK) { - pvar->recv_suspended = FALSE; + // recv()\x82̃u\x83\x8D\x83b\x83N\x82\xF0\x89\xF0\x8F\x9C\x82\xB7\x82\xE9\x81B + if (pvar->recv_suspended) { + pvar->recv_suspended = FALSE; + // FD_READ\x83\x81\x83b\x83Z\x81[\x83W\x82𓊂\xB0\x82\xC4 recv() \x82̍ĊJ\x82𑣂\xB7\x81B + PostMessage(pvar->NotificationWindow, WM_USER_COMMNOTIFY, pvar->socket, MAKELPARAM(FD_READ, 0)); + } } logprintf(LOG_LEVEL_NOTICE, Modified: branches/scp_flowctrl/ttssh2/ttxssh/ssh.h =================================================================== --- branches/scp_flowctrl/ttssh2/ttxssh/ssh.h 2019-08-13 13:38:22 UTC (rev 7949) +++ branches/scp_flowctrl/ttssh2/ttxssh/ssh.h 2019-08-13 15:09:07 UTC (rev 7950) @@ -828,7 +828,7 @@ // SCP\x8E\xF3\x90M\x8F\x88\x97\x9D\x82ɂ\xA8\x82\xAF\x82\xE9\x83t\x83\x8D\x81[\x90\xA7\x8C\xE4\x82\xCC臒l // \x93K\x97p\x90\xE6 scp_t.filercvsize -#define SCPRCV_HIGH_WATER_MARK (16 * 1024 * 1024) // 16MB +#define SCPRCV_HIGH_WATER_MARK (1 * 1024 * 1024) // 16MB #define SCPRCV_LOW_WATER_MARK (0) // 0MB typedef struct scp {