Revision: 8036 https://osdn.net/projects/ttssh2/scm/svn/commits/8036 Author: yutakapon Date: 2019-08-30 21:03:08 +0900 (Fri, 30 Aug 2019) Log Message: ----------- SSHサーバと認証中にネットワーク切断された場合、認証ダイアログが残ったままとならないようにした。 Modified Paths: -------------- branches/ttssh_improved/ttssh2/ttxssh/auth.c branches/ttssh_improved/ttssh2/ttxssh/auth.h branches/ttssh_improved/ttssh2/ttxssh/hosts.c branches/ttssh_improved/ttssh2/ttxssh/hosts.h branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: branches/ttssh_improved/ttssh2/ttxssh/auth.c =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/auth.c 2019-08-30 08:38:05 UTC (rev 8035) +++ branches/ttssh_improved/ttssh2/ttxssh/auth.c 2019-08-30 12:03:08 UTC (rev 8036) @@ -993,6 +993,12 @@ EndDialog(dlg, 0); return TRUE; + case IDCLOSE: + // \x94F\x8Fؒ\x86\x82Ƀl\x83b\x83g\x83\x8F\x81[\x83N\x90ؒf\x82\xB3\x82ꂽ\x8Fꍇ\x81A\x93\x96\x8AY\x83\x81\x83b\x83Z\x81[\x83W\x82Ń_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x81B + pvar->auth_state.auth_dialog = NULL; + EndDialog(dlg, 0); + return TRUE; + case IDC_SSHUSERNAME: // \x83\x86\x81[\x83U\x96\xBC\x82\xAA\x83t\x83H\x81[\x83J\x83X\x82\xF0\x8E\xB8\x82\xC1\x82\xBD\x82Ƃ\xAB (2007.9.29 maya) if (!(pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME) && @@ -1810,6 +1816,17 @@ } } +// TCP\x83Z\x83b\x83V\x83\x87\x83\x93\x82\xAA\x83N\x83\x8D\x81[\x83Y\x82\xB3\x82ꂽ\x8Fꍇ\x81A\x94F\x8F_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x82悤\x82Ɏw\x8E\xA6\x82\xF0\x8Fo\x82\xB7\x81B +// AUTH_notify_disconnecting()\x82Ƃ͈قȂ\xE8\x81A\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x82݂̂ŁA +// SSH\x83T\x81[\x83o\x82ɒʒm\x82͏o\x82\xB3\x82Ȃ\xA2\x81B +void AUTH_notify_closing_on_exit(PTInstVar pvar) +{ + if (pvar->auth_state.auth_dialog != NULL) { + logprintf(LOG_LEVEL_INFO, "%s: Notify closing message to the authentication dialog.", __FUNCTION__); + PostMessage(pvar->auth_state.auth_dialog, WM_COMMAND, IDCLOSE, 0); + } +} + void AUTH_end(PTInstVar pvar) { destroy_malloced_string(&pvar->auth_state.user); Modified: branches/ttssh_improved/ttssh2/ttxssh/auth.h =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/auth.h 2019-08-30 08:38:05 UTC (rev 8035) +++ branches/ttssh_improved/ttssh2/ttxssh/auth.h 2019-08-30 12:03:08 UTC (rev 8036) @@ -71,6 +71,7 @@ void AUTH_get_auth_info(PTInstVar pvar, char *dest, int len); void AUTH_notify_disconnecting(PTInstVar pvar); void AUTH_notify_end_error(PTInstVar pvar); +void AUTH_notify_closing_on_exit(PTInstVar pvar); void AUTH_end(PTInstVar pvar); void destroy_malloced_string(char **str); void init_password_control(PTInstVar pvar, HWND dlg, int item, BOOL *UseControlChar); Modified: branches/ttssh_improved/ttssh2/ttxssh/hosts.c =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/hosts.c 2019-08-30 08:38:05 UTC (rev 8035) +++ branches/ttssh_improved/ttssh2/ttxssh/hosts.c 2019-08-30 12:03:08 UTC (rev 8036) @@ -1829,6 +1829,12 @@ EndDialog(dlg, 0); return TRUE; + case IDCLOSE: + // \x94F\x8Fؒ\x86\x82Ƀl\x83b\x83g\x83\x8F\x81[\x83N\x90ؒf\x82\xB3\x82ꂽ\x8Fꍇ\x81A\x93\x96\x8AY\x83\x81\x83b\x83Z\x81[\x83W\x82Ń_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x81B + pvar->hosts_state.hosts_dialog = NULL; + EndDialog(dlg, 0); + return TRUE; + case IDC_FP_HASH_ALG_MD5: hosts_dlg_set_fingerprint(pvar, dlg, SSH_DIGEST_MD5); return TRUE; @@ -2313,6 +2319,17 @@ } } +// TCP\x83Z\x83b\x83V\x83\x87\x83\x93\x82\xAA\x83N\x83\x8D\x81[\x83Y\x82\xB3\x82ꂽ\x8Fꍇ\x81Aknown_hosts\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x82悤\x82Ɏw\x8E\xA6\x82\xF0\x8Fo\x82\xB7\x81B +// HOSTS_notify_disconnecting()\x82Ƃ͈قȂ\xE8\x81A\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\xB6\x82\xE9\x82݂̂ŁA +// SSH\x83T\x81[\x83o\x82ɒʒm\x82͏o\x82\xB3\x82Ȃ\xA2\x81B +void HOSTS_notify_closing_on_exit(PTInstVar pvar) +{ + if (pvar->hosts_state.hosts_dialog != NULL) { + logprintf(LOG_LEVEL_INFO, "%s: Notify closing message to the known_hosts dialog.", __FUNCTION__); + PostMessage(pvar->hosts_state.hosts_dialog, WM_COMMAND, IDCLOSE, 0); + } +} + void HOSTS_end(PTInstVar pvar) { int i; Modified: branches/ttssh_improved/ttssh2/ttxssh/hosts.h =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/hosts.h 2019-08-30 08:38:05 UTC (rev 8035) +++ branches/ttssh_improved/ttssh2/ttxssh/hosts.h 2019-08-30 12:03:08 UTC (rev 8036) @@ -70,6 +70,7 @@ void HOSTS_do_unknown_host_dialog(HWND wnd, PTInstVar pvar); void HOSTS_do_different_key_dialog(HWND wnd, PTInstVar pvar); void HOSTS_notify_disconnecting(PTInstVar pvar); +void HOSTS_notify_closing_on_exit(PTInstVar pvar); void HOSTS_end(PTInstVar pvar); int HOSTS_compare_public_key(Key *src, Key *key); Modified: branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c 2019-08-30 08:38:05 UTC (rev 8035) +++ branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c 2019-08-30 12:03:08 UTC (rev 8036) @@ -1130,6 +1130,10 @@ logputs(LOG_LEVEL_VERBOSE, "Terminating SSH session..."); + // \x94F\x8F_\x83C\x83A\x83\x8D\x83O\x82\xAA\x8Ec\x82\xC1\x82Ă\xA2\x82\xEA\x82Ε\xB6\x82\xE9\x81B + HOSTS_notify_closing_on_exit(pvar); + AUTH_notify_closing_on_exit(pvar); + *hooks->Precv = pvar->Precv; *hooks->Psend = pvar->Psend; *hooks->PWSAAsyncSelect = pvar->PWSAAsyncSelect;