Commit 35db594a7a9b8bdbb0913826f275799e643d7fac

Authored by Perry Werneck
1 parent 76612edf

Disconnect from SSL error should be marked as "failed" using

host_disconnected.
Showing 1 changed file with 6 additions and 3 deletions   Show diff stats
src/lib3270/ssl/negotiate.c
... ... @@ -52,6 +52,7 @@
52 52 #include <lib3270.h>
53 53 #include <lib3270/internals.h>
54 54 #include <lib3270/trace.h>
  55 +#include "hostc.h" // host_disconnect
55 56 #include "trace_dsc.h"
56 57  
57 58 /*--[ Implement ]------------------------------------------------------------------------------------*/
... ... @@ -152,7 +153,7 @@ static int background_ssl_negotiation(H3270 *hSession, void *message)
152 153  
153 154 ((SSL_ERROR_MESSAGE *) message)->title = N_( "Security error" );
154 155 ((SSL_ERROR_MESSAGE *) message)->text = N_( "SSL Connect failed" );
155   - lib3270_disconnect(hSession);
  156 +
156 157 return -1;
157 158  
158 159 }
... ... @@ -285,12 +286,13 @@ int ssl_negotiate(H3270 *hSession)
285 286 if(rc)
286 287 {
287 288 // SSL Negotiation has failed.
  289 + host_disconnect(hSession,1); // Disconnect with "failed" status.
  290 +
288 291 if(msg.description)
289 292 lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", msg.description);
290 293 else
291 294 lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", ERR_reason_error_string(msg.error));
292 295  
293   - lib3270_disconnect(hSession);
294 296  
295 297 }
296 298  
... ... @@ -312,12 +314,13 @@ int ssl_init(H3270 *hSession) {
312 314 if(rc)
313 315 {
314 316 // SSL init has failed.
  317 + host_disconnect(hSession,1); // Disconnect with "failed" status.
  318 +
315 319 if(msg.description)
316 320 lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", msg.description);
317 321 else
318 322 lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, msg.title, msg.text, "%s", ERR_reason_error_string(msg.error));
319 323  
320   - lib3270_disconnect(hSession);
321 324 }
322 325  
323 326 non_blocking(hSession,True);
... ...