diff --git a/src/lib3270/host.c b/src/lib3270/host.c index 8fe319a..254553a 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -397,6 +397,10 @@ LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h) { CHECK_SESSION_HANDLE(h); + // TODO: Find a better way! + if(!h->host.current) + lib3270_set_url(h,NULL); + if(h->host.current) return h->host.current; @@ -413,6 +417,11 @@ LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname) LIB3270_EXPORT const char * lib3270_get_srvcname(H3270 *h) { CHECK_SESSION_HANDLE(h); + + // TODO: Find a better way! + if(!h->host.srvc) + lib3270_set_url(h,NULL); + if(h->host.srvc) return h->host.srvc; return "telnet"; diff --git a/src/lib3270/properties.c b/src/lib3270/properties.c index 9803ac9..d51b06a 100644 --- a/src/lib3270/properties.c +++ b/src/lib3270/properties.c @@ -629,6 +629,10 @@ LIB3270_EXPORT int lib3270_get_secure_host(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); + // TODO: Find a better way! + if(!hSession->host.current) + lib3270_set_url(hSession,NULL); + #ifdef HAVE_LIBSSL return hSession->ssl.enabled ? 1 : 0; #else -- libgit2 0.21.2