Commit 87ed2906069da3bb6685ded8a663ce352a44169e

Authored by Perry Werneck
1 parent d892fdbb
Exists in master and in 2 other branches develop, macos

Debugging possible SSL problem.

@@ -519,7 +519,7 @@ AC_DEFINE(LIB3270_SDK_VERSION,$app_cv_sdkversion,[The SDK version number]) @@ -519,7 +519,7 @@ AC_DEFINE(LIB3270_SDK_VERSION,$app_cv_sdkversion,[The SDK version number])
519 AC_SUBST(LIB3270_SDK_VERSION,$app_cv_sdkversion) 519 AC_SUBST(LIB3270_SDK_VERSION,$app_cv_sdkversion)
520 520
521 AC_ARG_WITH([default-host], [AS_HELP_STRING([--with-default-host], [Set lib3270 default host url])], 521 AC_ARG_WITH([default-host], [AS_HELP_STRING([--with-default-host], [Set lib3270 default host url])],
522 - [ app_default_host="$withval"], 522 + [ app_default_host="\"$withval\""],
523 [ app_default_host=""]) 523 [ app_default_host=""])
524 524
525 AC_DEFINE_UNQUOTED(LIB3270_DEFAULT_HOST, $app_default_host, ["The default tn3270 host"]) 525 AC_DEFINE_UNQUOTED(LIB3270_DEFAULT_HOST, $app_default_host, ["The default tn3270 host"])
src/core/host.c
@@ -104,7 +104,11 @@ LIB3270_EXPORT int lib3270_disconnect(H3270 *h) { @@ -104,7 +104,11 @@ LIB3270_EXPORT int lib3270_disconnect(H3270 *h) {
104 return host_disconnect(h,0); 104 return host_disconnect(h,0);
105 } 105 }
106 106
  107 +/// @brief Do disconnect.
  108 +/// @param hSession Session handle.
  109 +/// @param failed Non zero if it was a failure.
107 int host_disconnect(H3270 *hSession, int failed) { 110 int host_disconnect(H3270 *hSession, int failed) {
  111 +
108 CHECK_SESSION_HANDLE(hSession); 112 CHECK_SESSION_HANDLE(hSession);
109 113
110 debug("%s: connected=%s half connected=%s network=%s", 114 debug("%s: connected=%s half connected=%s network=%s",
@@ -334,7 +338,7 @@ LIB3270_EXPORT const char * lib3270_get_default_host(const H3270 GNUC_UNUSED(*hS @@ -334,7 +338,7 @@ LIB3270_EXPORT const char * lib3270_get_default_host(const H3270 GNUC_UNUSED(*hS
334 #endif // _WIN32 338 #endif // _WIN32
335 339
336 #ifdef LIB3270_DEFAULT_HOST 340 #ifdef LIB3270_DEFAULT_HOST
337 - return LIB3270_STRINGIZE_VALUE_OF(LIB3270_DEFAULT_HOST); 341 + return LIB3270_DEFAULT_HOST;
338 #else 342 #else
339 return getenv("LIB3270_DEFAULT_HOST"); 343 return getenv("LIB3270_DEFAULT_HOST");
340 #endif // LIB3270_DEFAULT_HOST 344 #endif // LIB3270_DEFAULT_HOST
src/core/telnet.c
@@ -1479,7 +1479,7 @@ static void net_rawout(H3270 *hSession, unsigned const char *buf, size_t len) { @@ -1479,7 +1479,7 @@ static void net_rawout(H3270 *hSession, unsigned const char *buf, size_t len) {
1479 int nw = lib3270_sock_send(hSession,buf,len); 1479 int nw = lib3270_sock_send(hSession,buf,len);
1480 1480
1481 if (nw > 0) { 1481 if (nw > 0) {
1482 - // Data received 1482 + // Data sent
1483 hSession->ns_bsent += nw; 1483 hSession->ns_bsent += nw;
1484 len -= nw; 1484 len -= nw;
1485 buf += nw; 1485 buf += nw;
src/network_modules/openssl/context.c
@@ -66,8 +66,6 @@ static void info_callback(INFO_CONST SSL *s, int where, int ret) { @@ -66,8 +66,6 @@ static void info_callback(INFO_CONST SSL *s, int where, int ret) {
66 H3270 *hSession = (H3270 *) SSL_get_ex_data(s,ssl_ex_index); 66 H3270 *hSession = (H3270 *) SSL_get_ex_data(s,ssl_ex_index);
67 LIB3270_NET_CONTEXT * context = hSession->network.context; 67 LIB3270_NET_CONTEXT * context = hSession->network.context;
68 68
69 - debug("************************ %s where=%d",__FUNCTION__,where);  
70 -  
71 switch(where) { 69 switch(where) {
72 case SSL_CB_CONNECT_LOOP: 70 case SSL_CB_CONNECT_LOOP:
73 trace_ssl(hSession,"SSL_connect: %s %s\n",SSL_state_string(s), SSL_state_string_long(s)); 71 trace_ssl(hSession,"SSL_connect: %s %s\n",SSL_state_string(s), SSL_state_string_long(s));
src/testprogram/testprogram.c
@@ -110,9 +110,11 @@ int main(int argc, char *argv[]) { @@ -110,9 +110,11 @@ int main(int argc, char *argv[]) {
110 lib3270_crl_set_preferred_protocol(h,"ldap"); 110 lib3270_crl_set_preferred_protocol(h,"ldap");
111 #endif // HAVE_LDAP 111 #endif // HAVE_LDAP
112 112
113 - //if(lib3270_set_url(h,NULL))  
114 - // lib3270_set_url(h,"tn3270://127.0.0.1");  
115 - lib3270_set_url(h,"tn3270://localhost:3270"); 113 + lib3270_ssl_set_crl_download(h,0);
  114 +
  115 + if(lib3270_set_url(h,NULL))
  116 + lib3270_set_url(h,"tn3270://127.0.0.1");
  117 + //lib3270_set_url(h,"tn3270://localhost:3270");
116 118
117 int long_index =0; 119 int long_index =0;
118 int opt; 120 int opt;