Commit 9ca906680811a89baeefcf8219905e597e6e3a68

Authored by Perry Werneck
1 parent ed85745b

Fixing keyboard lock status and program messages issues.

Showing 2 changed files with 8 additions and 7 deletions   Show diff stats
src/core/screen.c
@@ -592,15 +592,16 @@ void status_reset(H3270 *session) @@ -592,15 +592,16 @@ void status_reset(H3270 *session)
592 } 592 }
593 593
594 /** 594 /**
595 - * Query the updated terminal status. 595 + * @brief Query the updated terminal status.
596 * 596 *
597 * @return status-code. 597 * @return status-code.
598 * 598 *
599 * @see LIB3270_MESSAGE 599 * @see LIB3270_MESSAGE
600 */ 600 */
601 -LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *session) 601 +LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *hSession)
602 { 602 {
603 - return session->oia.status; 603 + debug("OIA Status=%d",hSession->oia.status);
  604 + return hSession->oia.status;
604 } 605 }
605 606
606 /** 607 /**
@@ -616,12 +617,12 @@ LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *session) @@ -616,12 +617,12 @@ LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(const H3270 *session)
616 */ 617 */
617 LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_lock_status(const H3270 *hSession) 618 LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_lock_status(const H3270 *hSession)
618 { 619 {
619 - if(hSession->oia.status)  
620 - return hSession->oia.status;  
621 -  
622 if(hSession->kybdlock) 620 if(hSession->kybdlock)
623 return LIB3270_MESSAGE_KYBDLOCK; 621 return LIB3270_MESSAGE_KYBDLOCK;
624 622
  623 + if(hSession->oia.status)
  624 + return hSession->oia.status;
  625 +
625 return LIB3270_MESSAGE_NONE; 626 return LIB3270_MESSAGE_NONE;
626 627
627 } 628 }
src/core/session.c
@@ -334,7 +334,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -334,7 +334,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
334 hSession->connection.sock = -1; 334 hSession->connection.sock = -1;
335 hSession->model_num = -1; 335 hSession->model_num = -1;
336 hSession->connection.state = LIB3270_NOT_CONNECTED; 336 hSession->connection.state = LIB3270_NOT_CONNECTED;
337 - hSession->oia.status = -1; 337 + hSession->oia.status = LIB3270_MESSAGE_DISCONNECTED;
338 hSession->kybdlock = KL_NOT_CONNECTED; 338 hSession->kybdlock = KL_NOT_CONNECTED;
339 hSession->aid = AID_NO; 339 hSession->aid = AID_NO;
340 hSession->reply_mode = SF_SRM_FIELD; 340 hSession->reply_mode = SF_SRM_FIELD;