Commit efc4c9eaa49b5954007d289a0a11e0f7eed403a9

Authored by Perry Werneck
1 parent 310404f3

Indicador de SSL não estava atualizando em algumas situações.

Showing 2 changed files with 18 additions and 11 deletions   Show diff stats
@@ -135,12 +135,19 @@ void lib3270_set_disconnected(H3270 *hSession) @@ -135,12 +135,19 @@ void lib3270_set_disconnected(H3270 *hSession)
135 135
136 hSession->cstate = LIB3270_NOT_CONNECTED; 136 hSession->cstate = LIB3270_NOT_CONNECTED;
137 hSession->starting = 0; 137 hSession->starting = 0;
  138 + hSession->secure = LIB3270_SSL_UNDEFINED;
138 139
139 set_status(hSession,OIA_FLAG_UNDERA,False); 140 set_status(hSession,OIA_FLAG_UNDERA,False);
  141 +
140 lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False); 142 lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False);
  143 +
141 status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED); 144 status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED);
  145 +
142 if(hSession->update_connect) 146 if(hSession->update_connect)
143 hSession->update_connect(hSession,0); 147 hSession->update_connect(hSession,0);
  148 +
  149 + hSession->update_ssl(hSession,hSession->secure);
  150 +
144 } 151 }
145 152
146 /* Register a function interested in a state change. */ 153 /* Register a function interested in a state change. */
@@ -418,16 +418,6 @@ void ssl_info_callback(INFO_CONST SSL *s, int where, int ret) @@ -418,16 +418,6 @@ void ssl_info_callback(INFO_CONST SSL *s, int where, int ret)
418 418
419 #endif /*]*/ 419 #endif /*]*/
420 420
421 -LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session)  
422 -{  
423 - CHECK_SESSION_HANDLE(session);  
424 -  
425 - if(!lib3270_is_connected(session))  
426 - return LIB3270_SSL_UNDEFINED;  
427 -  
428 - return session->secure;  
429 -}  
430 -  
431 LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession) 421 LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession)
432 { 422 {
433 return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE; 423 return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE;
@@ -443,12 +433,22 @@ LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession) @@ -443,12 +433,22 @@ LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession)
443 return -1; 433 return -1;
444 } 434 }
445 435
  436 +LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session)
  437 +{
  438 + CHECK_SESSION_HANDLE(session);
  439 +
  440 + return session->secure;
  441 +}
  442 +
446 void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state) 443 void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state)
447 { 444 {
  445 + CHECK_SESSION_HANDLE(session);
  446 +
448 if(state == session->secure) 447 if(state == session->secure)
449 return; 448 return;
450 449
  450 + session->secure = state;
451 trace_dsn(session,"SSL state changes to %d\n",(int) state); 451 trace_dsn(session,"SSL state changes to %d\n",(int) state);
452 452
453 - session->update_ssl(session,session->secure = state); 453 + session->update_ssl(session,session->secure);
454 } 454 }