Commit 565bf6b645c1e407e760893b1dd85beb9bec3db1

Authored by perry.werneck@gmail.com
1 parent 58b3a2e8
Exists in master

Atualizando indicador de SSL para usar a estrutura de sessao na função exportada pela API

latest/src/include/lib3270.h
@@ -252,11 +252,23 @@ @@ -252,11 +252,23 @@
252 */ 252 */
253 LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *h, LIB3270_TOGGLE ix); 253 LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *h, LIB3270_TOGGLE ix);
254 254
  255 + /**
  256 + * Check if the active connection is secure.
  257 + *
  258 + * @param h Session handle.
  259 + *
  260 + * @return Non 0 if the connection is SSL secured, 0 if not.
  261 + */
  262 + LIB3270_EXPORT int lib3270_get_ssl_state(H3270 *h);
  263 +
  264 +
  265 +
255 LIB3270_EXPORT STATUS_CODE lib3270_get_oia_status(H3270 *h); 266 LIB3270_EXPORT STATUS_CODE lib3270_get_oia_status(H3270 *h);
256 LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h); 267 LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h);
257 LIB3270_EXPORT const char * lib3270_get_host(H3270 *h); 268 LIB3270_EXPORT const char * lib3270_get_host(H3270 *h);
258 269
259 #define lib3270_has_printer_session(h) (h->oia_flag[LIB3270_FLAG_PRINTER] != 0) 270 #define lib3270_has_printer_session(h) (h->oia_flag[LIB3270_FLAG_PRINTER] != 0)
260 #define lib3270_has_active_script(h) (h->oia_flag[LIB3270_FLAG_SCRIPT] != 0) 271 #define lib3270_has_active_script(h) (h->oia_flag[LIB3270_FLAG_SCRIPT] != 0)
  272 + #define lib3270_get_typeahead(h) (h->oia_flag[LIB3270_FLAG_TYPEAHEAD] != 0)
261 273
262 #endif // LIB3270_H_INCLUDED 274 #endif // LIB3270_H_INCLUDED
latest/src/include/lib3270/api.h
@@ -551,8 +551,8 @@ @@ -551,8 +551,8 @@
551 LIB3270_EXPORT int screen_read(char *dest, int baddr, int count); 551 LIB3270_EXPORT int screen_read(char *dest, int baddr, int count);
552 LIB3270_EXPORT void Input_String(const unsigned char *str); 552 LIB3270_EXPORT void Input_String(const unsigned char *str);
553 LIB3270_EXPORT void screen_size(int *rows, int *cols); 553 LIB3270_EXPORT void screen_size(int *rows, int *cols);
554 - LIB3270_EXPORT int query_secure_connection(H3270 *h);  
555 554
  555 + #define query_secure_connection(h) lib3270_get_ssl_state(h)
556 #define lib3270_paste_string(str) lib3270_set_string(NULL,str) 556 #define lib3270_paste_string(str) lib3270_set_string(NULL,str)
557 #define get_3270_terminal_size(h,r,c) lib3270_get_screen_size(h,r,c) 557 #define get_3270_terminal_size(h,r,c) lib3270_get_screen_size(h,r,c)
558 558
latest/src/lib/telnet.c
@@ -3414,12 +3414,12 @@ net_proxy_port(void) @@ -3414,12 +3414,12 @@ net_proxy_port(void)
3414 return NULL; 3414 return NULL;
3415 } 3415 }
3416 3416
3417 -int query_secure_connection(H3270 *h) 3417 +LIB3270_EXPORT int lib3270_get_ssl_state(H3270 *h)
3418 { 3418 {
  3419 + CHECK_SESSION_HANDLE(h);
  3420 +
3419 #if defined(HAVE_LIBSSL) 3421 #if defined(HAVE_LIBSSL)
3420 - if(h)  
3421 - return h->secure_connection;  
3422 - return h3270.secure_connection; 3422 + return (h->secure_connection != 0);
3423 #else 3423 #else
3424 return 0; 3424 return 0;
3425 #endif 3425 #endif
latest/src/plugins/java/j3270plugin.c
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 #include <libintl.h> 46 #include <libintl.h>
47 #include <glib/gi18n.h> 47 #include <glib/gi18n.h>
48 48
49 - #include <lib3270/api.h> 49 + #include <lib3270.h>
50 #include <lib3270/plugins.h> 50 #include <lib3270/plugins.h>
51 51
52 // References: 52 // References:
latest/src/plugins/rexx/rx3270.h
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 104
105 /* include the lib3270 stuff */ 105 /* include the lib3270 stuff */
106 #define LIB3270_MODULE_NAME "rexx" 106 #define LIB3270_MODULE_NAME "rexx"
107 - #include <lib3270/api.h> 107 + #include <lib3270.h>
108 #include <lib3270/plugins.h> 108 #include <lib3270/plugins.h>
109 // #include <lib3270/statusc.h> 109 // #include <lib3270/statusc.h>
110 #include <lib3270/toggle.h> 110 #include <lib3270/toggle.h>