From 35db594a7a9b8bdbb0913826f275799e643d7fac Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 16 Jan 2019 10:16:09 -0200 Subject: [PATCH] Disconnect from SSL error should be marked as "failed" using host_disconnected. --- src/lib3270/ssl/negotiate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib3270/ssl/negotiate.c b/src/lib3270/ssl/negotiate.c index 9a86a6d..5c09ade 100644 --- a/src/lib3270/ssl/negotiate.c +++ b/src/lib3270/ssl/negotiate.c @@ -52,6 +52,7 @@ #include #include #include +#include "hostc.h" // host_disconnect #include "trace_dsc.h" /*--[ Implement ]------------------------------------------------------------------------------------*/ @@ -152,7 +153,7 @@ static int background_ssl_negotiation(H3270 *hSession, void *message) ((SSL_ERROR_MESSAGE *) message)->title = N_( "Security error" ); ((SSL_ERROR_MESSAGE *) message)->text = N_( "SSL Connect failed" ); - lib3270_disconnect(hSession); + return -1; } @@ -285,12 +286,13 @@ int ssl_negotiate(H3270 *hSession) if(rc) { // SSL Negotiation has failed. + host_disconnect(hSession,1); // Disconnect with "failed" status. + if(msg.description) lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", msg.description); else lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", ERR_reason_error_string(msg.error)); - lib3270_disconnect(hSession); } @@ -312,12 +314,13 @@ int ssl_init(H3270 *hSession) { if(rc) { // SSL init has failed. + host_disconnect(hSession,1); // Disconnect with "failed" status. + if(msg.description) lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", msg.description); else lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", ERR_reason_error_string(msg.error)); - lib3270_disconnect(hSession); } non_blocking(hSession,True); -- libgit2 0.21.2