diff --git a/src/core/connect.c b/src/core/connect.c index 53f94a9..1bdd34c 100644 --- a/src/core/connect.c +++ b/src/core/connect.c @@ -53,32 +53,6 @@ } -/* - void connection_failed(H3270 *hSession, const char *message) - { - lib3270_disconnect(hSession); - - lib3270_autoptr(char) summary = lib3270_strdup_printf( - _( "Can't connect to %s:%s"), - hSession->host.current, - hSession->host.srvc - ); - - LIB3270_POPUP popup = { - .name = "CantConnect", -// .title = _( "Connection failed" ), - .type = LIB3270_NOTIFY_INFO, - .summary = summary, - .body = message, - .label = _("Try again") - }; - - if(hSession->cbk.popup(hSession,&popup,!hSession->auto_reconnect_inprogress) == 0) - lib3270_activate_auto_reconnect(hSession,1000); - - } -*/ - int lib3270_allow_reconnect(const H3270 *hSession) { // @@ -103,7 +77,8 @@ // Do I have a defined host? if(!(hSession->host.current && hSession->host.srvc && *hSession->host.current && *hSession->host.srvc)) { - errno = EINVAL; + debug("%s('%s')",__FUNCTION__,hSession->host.url); + errno = ENODATA; return 0; } diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 4124dcf..81dff9b 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -546,6 +546,10 @@ * * @return zero if reconnect is unavailable (sets errno), non zero if available. * + * @retval ENODATA Invalid or empty hostname. + * @retval EBUSY Auto reconnect in progress. + * @retval EISCONN Session is connected. + * */ LIB3270_EXPORT int lib3270_allow_reconnect(const H3270 *hSession); @@ -557,6 +561,11 @@ * * @return 0 for success, non zero if fails (sets errno). * + * @retval ENODATA Invalid or empty hostname. + * @retval EBUSY Auto reconnect in progress. + * @retval EISCONN Session is connected. + * @retval -1 Unexpected error. + * */ LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int seconds); -- libgit2 0.21.2