Commit b63d6671a95dc231a88a978f31fea3021d1549b5

Authored by Perry Werneck
1 parent 120f863e

Forcing use of default url (when defined) on convenience calls for

getting host, service and ssl status (for use on host selection dialog).
Showing 2 changed files with 13 additions and 0 deletions   Show diff stats
src/lib3270/host.c
@@ -397,6 +397,10 @@ LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h) @@ -397,6 +397,10 @@ LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h)
397 { 397 {
398 CHECK_SESSION_HANDLE(h); 398 CHECK_SESSION_HANDLE(h);
399 399
  400 + // TODO: Find a better way!
  401 + if(!h->host.current)
  402 + lib3270_set_url(h,NULL);
  403 +
400 if(h->host.current) 404 if(h->host.current)
401 return h->host.current; 405 return h->host.current;
402 406
@@ -413,6 +417,11 @@ LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname) @@ -413,6 +417,11 @@ LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname)
413 LIB3270_EXPORT const char * lib3270_get_srvcname(H3270 *h) 417 LIB3270_EXPORT const char * lib3270_get_srvcname(H3270 *h)
414 { 418 {
415 CHECK_SESSION_HANDLE(h); 419 CHECK_SESSION_HANDLE(h);
  420 +
  421 + // TODO: Find a better way!
  422 + if(!h->host.srvc)
  423 + lib3270_set_url(h,NULL);
  424 +
416 if(h->host.srvc) 425 if(h->host.srvc)
417 return h->host.srvc; 426 return h->host.srvc;
418 return "telnet"; 427 return "telnet";
src/lib3270/properties.c
@@ -629,6 +629,10 @@ LIB3270_EXPORT int lib3270_get_secure_host(H3270 *hSession) @@ -629,6 +629,10 @@ LIB3270_EXPORT int lib3270_get_secure_host(H3270 *hSession)
629 { 629 {
630 CHECK_SESSION_HANDLE(hSession); 630 CHECK_SESSION_HANDLE(hSession);
631 631
  632 + // TODO: Find a better way!
  633 + if(!hSession->host.current)
  634 + lib3270_set_url(hSession,NULL);
  635 +
632 #ifdef HAVE_LIBSSL 636 #ifdef HAVE_LIBSSL
633 return hSession->ssl.enabled ? 1 : 0; 637 return hSession->ssl.enabled ? 1 : 0;
634 #else 638 #else