From f25d39782c8375ebebdaf216108dab1d1769c662 Mon Sep 17 00:00:00 2001 From: Alexander Melkov Date: Sun, 26 Mar 2023 19:04:23 +0300 Subject: [PATCH] resolves #360: window closes if dns resolution fails after reconnect --- 0.76_My_PuTTY/windows/window.c | 11 ++++++----- 0.76b_My_PuTTY/windows/window.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/0.76_My_PuTTY/windows/window.c b/0.76_My_PuTTY/windows/window.c index 76a0397..44c8a3e 100644 --- a/0.76_My_PuTTY/windows/window.c +++ b/0.76_My_PuTTY/windows/window.c @@ -685,22 +685,23 @@ static void start_backend(void) start_backend() ; return ; } - } else { + } else if( !is_backend_first_connected ) { MessageBox(NULL, msg, str, MB_OK); } } sfree(str); sfree(msg); + SetSSHConnected(0) ; + queue_toplevel_callback(close_session, NULL); + session_closed = true; if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) { SetConnBreakIcon(wgs.term_hwnd) ; - SetSSHConnected(0) ; - queue_toplevel_callback(close_session, NULL); - session_closed = true; lp_eventlog(&wgs.logpolicy, "Unable to connect, trying to reconnect...") ; SetTimer(wgs.term_hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; + } + if( is_backend_first_connected ) { return ; } - else #else char *str = dupprintf("%s Error", appname); char *msg = dupprintf("Unable to open connection to\n%s\n%s", diff --git a/0.76b_My_PuTTY/windows/window.c b/0.76b_My_PuTTY/windows/window.c index 8e5768b..e4a0668 100644 --- a/0.76b_My_PuTTY/windows/window.c +++ b/0.76b_My_PuTTY/windows/window.c @@ -685,22 +685,23 @@ static void start_backend(void) start_backend() ; return ; } - } else { + } else if( !is_backend_first_connected ) { MessageBox(NULL, msg, str, MB_OK); } } sfree(str); sfree(msg); + SetSSHConnected(0) ; + queue_toplevel_callback(close_session, NULL); + session_closed = true; if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) { SetConnBreakIcon(wgs.term_hwnd) ; - SetSSHConnected(0) ; - queue_toplevel_callback(close_session, NULL); - session_closed = true; lp_eventlog(&wgs.logpolicy, "Unable to connect, trying to reconnect...") ; SetTimer(wgs.term_hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; + } + if( is_backend_first_connected ) { return ; } - else #else char *str = dupprintf("%s Error", appname); char *msg = dupprintf("Unable to open connection to\n%s\n%s",