Commit ed00bf6677c05b7479d8c954e2eea980b42f8996
1 parent
9d913eee
Exists in
master
and in
2 other branches
Allowing customized reconnect method.
Showing
6 changed files
with
10 additions
and
6 deletions
Show diff stats
src/core/actions/table.c
src/core/connect.c
src/core/host.c
... | ... | @@ -74,7 +74,7 @@ static int check_for_auto_reconnect(H3270 *hSession, void GNUC_UNUSED(*userdata) |
74 | 74 | { |
75 | 75 | lib3270_write_log(hSession,"3270","Starting auto-reconnect on %s",lib3270_get_url(hSession)); |
76 | 76 | hSession->auto_reconnect_inprogress = 0; // Reset "in-progress" to allow reconnection. |
77 | - if(lib3270_reconnect(hSession,0)) | |
77 | + if(hSession->cbk.reconnect(hSession,0)) | |
78 | 78 | lib3270_write_log(hSession,"3270","Auto-reconnect fails: %s",strerror(errno)); |
79 | 79 | } |
80 | 80 | ... | ... |
src/core/session.c
... | ... | @@ -305,6 +305,7 @@ void lib3270_reset_callbacks(H3270 *hSession) |
305 | 305 | hSession->cbk.update_luname = default_update_luname; |
306 | 306 | hSession->cbk.update_url = default_update_url; |
307 | 307 | hSession->cbk.action = default_action; |
308 | + hSession->cbk.reconnect = lib3270_reconnect; | |
308 | 309 | |
309 | 310 | lib3270_set_popup_handler(hSession, NULL); |
310 | 311 | |
... | ... | @@ -551,9 +552,11 @@ LIB3270_EXPORT char lib3270_get_session_id(H3270 *hSession) |
551 | 552 | |
552 | 553 | struct lib3270_session_callbacks * lib3270_get_session_callbacks(H3270 *hSession, const char *revision, unsigned short sz) |
553 | 554 | { |
554 | - if(revision && strcasecmp(revision,"20200803") < 0) | |
555 | + #define REQUIRED_REVISION "20201117" | |
556 | + | |
557 | + if(revision && strcasecmp(revision,REQUIRED_REVISION) < 0) | |
555 | 558 | { |
556 | - debug("%s: Revision test was %d",__FUNCTION__,strcasecmp(revision,"20200803")); | |
559 | + debug("%s: Revision test was %d",__FUNCTION__,strcasecmp(revision,REQUIRED_REVISION)); | |
557 | 560 | errno = EINVAL; |
558 | 561 | return NULL; |
559 | 562 | } | ... | ... |
src/core/toggles/init.c
... | ... | @@ -100,7 +100,7 @@ static void toggle_connect(H3270 *hSession, const struct lib3270_toggle *toggle, |
100 | 100 | { |
101 | 101 | if(tt != LIB3270_TOGGLE_TYPE_INITIAL && lib3270_is_disconnected(hSession) && toggle->value) |
102 | 102 | { |
103 | - if(lib3270_reconnect(hSession,0)) | |
103 | + if(hSession->cbk.reconnect(hSession,0)) | |
104 | 104 | lib3270_write_log(hSession,"3270","Auto-connect fails: %s",strerror(errno)); |
105 | 105 | } |
106 | 106 | ... | ... |