From 565bf6b645c1e407e760893b1dd85beb9bec3db1 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 31 Jan 2012 18:16:05 +0000 Subject: [PATCH] Atualizando indicador de SSL para usar a estrutura de sessao na função exportada pela API --- latest/src/include/lib3270.h | 12 ++++++++++++ latest/src/include/lib3270/api.h | 2 +- latest/src/lib/telnet.c | 8 ++++---- latest/src/plugins/java/j3270plugin.c | 2 +- latest/src/plugins/rexx/rx3270.h | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/latest/src/include/lib3270.h b/latest/src/include/lib3270.h index 63fbd01..480f23a 100644 --- a/latest/src/include/lib3270.h +++ b/latest/src/include/lib3270.h @@ -252,11 +252,23 @@ */ LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *h, LIB3270_TOGGLE ix); + /** + * Check if the active connection is secure. + * + * @param h Session handle. + * + * @return Non 0 if the connection is SSL secured, 0 if not. + */ + LIB3270_EXPORT int lib3270_get_ssl_state(H3270 *h); + + + LIB3270_EXPORT STATUS_CODE lib3270_get_oia_status(H3270 *h); LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h); LIB3270_EXPORT const char * lib3270_get_host(H3270 *h); #define lib3270_has_printer_session(h) (h->oia_flag[LIB3270_FLAG_PRINTER] != 0) #define lib3270_has_active_script(h) (h->oia_flag[LIB3270_FLAG_SCRIPT] != 0) + #define lib3270_get_typeahead(h) (h->oia_flag[LIB3270_FLAG_TYPEAHEAD] != 0) #endif // LIB3270_H_INCLUDED diff --git a/latest/src/include/lib3270/api.h b/latest/src/include/lib3270/api.h index 420f8d3..ba59702 100644 --- a/latest/src/include/lib3270/api.h +++ b/latest/src/include/lib3270/api.h @@ -551,8 +551,8 @@ LIB3270_EXPORT int screen_read(char *dest, int baddr, int count); LIB3270_EXPORT void Input_String(const unsigned char *str); LIB3270_EXPORT void screen_size(int *rows, int *cols); - LIB3270_EXPORT int query_secure_connection(H3270 *h); + #define query_secure_connection(h) lib3270_get_ssl_state(h) #define lib3270_paste_string(str) lib3270_set_string(NULL,str) #define get_3270_terminal_size(h,r,c) lib3270_get_screen_size(h,r,c) diff --git a/latest/src/lib/telnet.c b/latest/src/lib/telnet.c index 2091287..b3ad502 100644 --- a/latest/src/lib/telnet.c +++ b/latest/src/lib/telnet.c @@ -3414,12 +3414,12 @@ net_proxy_port(void) return NULL; } -int query_secure_connection(H3270 *h) +LIB3270_EXPORT int lib3270_get_ssl_state(H3270 *h) { + CHECK_SESSION_HANDLE(h); + #if defined(HAVE_LIBSSL) - if(h) - return h->secure_connection; - return h3270.secure_connection; + return (h->secure_connection != 0); #else return 0; #endif diff --git a/latest/src/plugins/java/j3270plugin.c b/latest/src/plugins/java/j3270plugin.c index 80dc7e3..ce7887c 100644 --- a/latest/src/plugins/java/j3270plugin.c +++ b/latest/src/plugins/java/j3270plugin.c @@ -46,7 +46,7 @@ #include #include - #include + #include #include // References: diff --git a/latest/src/plugins/rexx/rx3270.h b/latest/src/plugins/rexx/rx3270.h index 090e144..b37da25 100644 --- a/latest/src/plugins/rexx/rx3270.h +++ b/latest/src/plugins/rexx/rx3270.h @@ -104,7 +104,7 @@ /* include the lib3270 stuff */ #define LIB3270_MODULE_NAME "rexx" - #include + #include #include // #include #include -- libgit2 0.21.2