Commit 8d1d84b0f7b9cc50bf7c3975a3e3c2ffc7ca35dd
1 parent
fe415dde
Exists in
master
and in
3 other branches
Fixing popup dialog when connection fails.
Showing
3 changed files
with
8 additions
and
2 deletions
Show diff stats
src/core/connect.c
| ... | ... | @@ -86,6 +86,7 @@ |
| 86 | 86 | // |
| 87 | 87 | if(hSession->auto_reconnect_inprogress) |
| 88 | 88 | { |
| 89 | + debug("%s: auto_reconnect_inprogress",__FUNCTION__); | |
| 89 | 90 | errno = EBUSY; |
| 90 | 91 | return 0; |
| 91 | 92 | } |
| ... | ... | @@ -93,6 +94,7 @@ |
| 93 | 94 | // Is the session disconnected? |
| 94 | 95 | if(!lib3270_is_disconnected(hSession)) |
| 95 | 96 | { |
| 97 | + debug("%s: is_disconnected=FALSE",__FUNCTION__); | |
| 96 | 98 | errno = EISCONN; |
| 97 | 99 | return 0; |
| 98 | 100 | } | ... | ... |
src/core/linux/connect.c
| ... | ... | @@ -292,7 +292,9 @@ |
| 292 | 292 | popup->body = syserror; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - if(hSession->cbk.popup(hSession,popup,!hSession->auto_reconnect_inprogress) == 0) | |
| 295 | + lib3270_disconnect(hSession); // To cleanup states. | |
| 296 | + | |
| 297 | + if(lib3270_popup(hSession,popup,!hSession->auto_reconnect_inprogress) == 0) | |
| 296 | 298 | lib3270_activate_auto_reconnect(hSession,1000); |
| 297 | 299 | |
| 298 | 300 | return errno = ENOTCONN; | ... | ... |
src/core/popup.c
| ... | ... | @@ -42,7 +42,9 @@ |
| 42 | 42 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 43 | 43 | |
| 44 | 44 | LIB3270_EXPORT int lib3270_popup(H3270 *hSession, const LIB3270_POPUP *popup, unsigned char wait) { |
| 45 | - return hSession->cbk.popup(hSession,popup,wait); | |
| 45 | + int rc = hSession->cbk.popup(hSession,popup,wait); | |
| 46 | + debug("%s rc=%d (%s)",__FUNCTION__,rc,strerror(rc)); | |
| 47 | + return rc; | |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | int lib3270_popup_translated(H3270 *hSession, const LIB3270_POPUP *popup, unsigned char wait) { | ... | ... |