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
host.c
... ... @@ -135,12 +135,19 @@ void lib3270_set_disconnected(H3270 *hSession)
135 135  
136 136 hSession->cstate = LIB3270_NOT_CONNECTED;
137 137 hSession->starting = 0;
  138 + hSession->secure = LIB3270_SSL_UNDEFINED;
138 139  
139 140 set_status(hSession,OIA_FLAG_UNDERA,False);
  141 +
140 142 lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False);
  143 +
141 144 status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED);
  145 +
142 146 if(hSession->update_connect)
143 147 hSession->update_connect(hSession,0);
  148 +
  149 + hSession->update_ssl(hSession,hSession->secure);
  150 +
144 151 }
145 152  
146 153 /* Register a function interested in a state change. */
... ...
ssl.c
... ... @@ -418,16 +418,6 @@ void ssl_info_callback(INFO_CONST SSL *s, int where, int ret)
418 418  
419 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 421 LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession)
432 422 {
433 423 return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE;
... ... @@ -443,12 +433,22 @@ LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession)
443 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 443 void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state)
447 444 {
  445 + CHECK_SESSION_HANDLE(session);
  446 +
448 447 if(state == session->secure)
449 448 return;
450 449  
  450 + session->secure = state;
451 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 }
... ...