diff --git a/src/core/actions/table.c b/src/core/actions/table.c index 7648a44..6fb37e3 100644 --- a/src/core/actions/table.c +++ b/src/core/actions/table.c @@ -48,7 +48,7 @@ static int connect_host(H3270 *hSession) { - return lib3270_reconnect(hSession,0); + return hSession->cbk.reconnect(hSession,0); } static int select_up(H3270 *hSession) diff --git a/src/core/connect.c b/src/core/connect.c index cbed4a4..53f94a9 100644 --- a/src/core/connect.c +++ b/src/core/connect.c @@ -49,7 +49,7 @@ lib3270_set_url(hSession,url); } - return lib3270_reconnect(hSession, seconds); + return hSession->cbk.reconnect(hSession, seconds); } diff --git a/src/core/host.c b/src/core/host.c index 5293319..86cf417 100644 --- a/src/core/host.c +++ b/src/core/host.c @@ -74,7 +74,7 @@ static int check_for_auto_reconnect(H3270 *hSession, void GNUC_UNUSED(*userdata) { lib3270_write_log(hSession,"3270","Starting auto-reconnect on %s",lib3270_get_url(hSession)); hSession->auto_reconnect_inprogress = 0; // Reset "in-progress" to allow reconnection. - if(lib3270_reconnect(hSession,0)) + if(hSession->cbk.reconnect(hSession,0)) lib3270_write_log(hSession,"3270","Auto-reconnect fails: %s",strerror(errno)); } diff --git a/src/core/session.c b/src/core/session.c index c7ef5c9..40442aa 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -305,6 +305,7 @@ void lib3270_reset_callbacks(H3270 *hSession) hSession->cbk.update_luname = default_update_luname; hSession->cbk.update_url = default_update_url; hSession->cbk.action = default_action; + hSession->cbk.reconnect = lib3270_reconnect; lib3270_set_popup_handler(hSession, NULL); @@ -551,9 +552,11 @@ LIB3270_EXPORT char lib3270_get_session_id(H3270 *hSession) struct lib3270_session_callbacks * lib3270_get_session_callbacks(H3270 *hSession, const char *revision, unsigned short sz) { - if(revision && strcasecmp(revision,"20200803") < 0) + #define REQUIRED_REVISION "20201117" + + if(revision && strcasecmp(revision,REQUIRED_REVISION) < 0) { - debug("%s: Revision test was %d",__FUNCTION__,strcasecmp(revision,"20200803")); + debug("%s: Revision test was %d",__FUNCTION__,strcasecmp(revision,REQUIRED_REVISION)); errno = EINVAL; return NULL; } diff --git a/src/core/toggles/init.c b/src/core/toggles/init.c index a9fbc5f..f32b020 100644 --- a/src/core/toggles/init.c +++ b/src/core/toggles/init.c @@ -100,7 +100,7 @@ static void toggle_connect(H3270 *hSession, const struct lib3270_toggle *toggle, { if(tt != LIB3270_TOGGLE_TYPE_INITIAL && lib3270_is_disconnected(hSession) && toggle->value) { - if(lib3270_reconnect(hSession,0)) + if(hSession->cbk.reconnect(hSession,0)) lib3270_write_log(hSession,"3270","Auto-connect fails: %s",strerror(errno)); } diff --git a/src/include/lib3270/session.h b/src/include/lib3270/session.h index 9013c97..20a4c29 100644 --- a/src/include/lib3270/session.h +++ b/src/include/lib3270/session.h @@ -79,6 +79,7 @@ int (*action)(H3270 *hSession, const char *name); + int (*reconnect)(H3270 *hSession,int seconds); }; /** -- libgit2 0.21.2