From efc4c9eaa49b5954007d289a0a11e0f7eed403a9 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 6 Apr 2016 09:39:33 -0300 Subject: [PATCH] Indicador de SSL não estava atualizando em algumas situações. --- host.c | 7 +++++++ ssl.c | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/host.c b/host.c index 41cad48..bfc4cf7 100644 --- a/host.c +++ b/host.c @@ -135,12 +135,19 @@ void lib3270_set_disconnected(H3270 *hSession) hSession->cstate = LIB3270_NOT_CONNECTED; hSession->starting = 0; + hSession->secure = LIB3270_SSL_UNDEFINED; set_status(hSession,OIA_FLAG_UNDERA,False); + lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False); + status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED); + if(hSession->update_connect) hSession->update_connect(hSession,0); + + hSession->update_ssl(hSession,hSession->secure); + } /* Register a function interested in a state change. */ diff --git a/ssl.c b/ssl.c index e5b335e..fea99b0 100644 --- a/ssl.c +++ b/ssl.c @@ -418,16 +418,6 @@ void ssl_info_callback(INFO_CONST SSL *s, int where, int ret) #endif /*]*/ -LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session) -{ - CHECK_SESSION_HANDLE(session); - - if(!lib3270_is_connected(session)) - return LIB3270_SSL_UNDEFINED; - - return session->secure; -} - LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession) { return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE; @@ -443,12 +433,22 @@ LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession) return -1; } +LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session) +{ + CHECK_SESSION_HANDLE(session); + + return session->secure; +} + void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state) { + CHECK_SESSION_HANDLE(session); + if(state == session->secure) return; + session->secure = state; trace_dsn(session,"SSL state changes to %d\n",(int) state); - session->update_ssl(session,session->secure = state); + session->update_ssl(session,session->secure); } -- libgit2 0.21.2