From b111ffc0063f5540207e90014adccf2ae520bed8 Mon Sep 17 00:00:00 2001 From: Wonkeun Oh Date: Fri, 13 Jan 2017 14:41:58 +0900 Subject: [PATCH] Added to send fail_reply message in the panel_agent's socket communication. Because there was a missing reply message in the socket communication. Even if there is no reply data or fail case in the socket, It should send the reply message to prevent the client side's timeout. This patch fixed the 5 sec delay of helper_agent when the helper_agent(IME) is relaunched Change-Id: I0bab779ea508bd108005e7707de98e9105484d3e --- .../panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp | 10 +++++++--- ism/src/isf_info_manager.cpp | 7 +++++-- ism/src/isf_panel_agent_base.cpp | 4 ++++ ism/src/isf_panel_agent_base.h | 10 ++++++++++ ism/src/isf_panel_agent_manager.cpp | 8 ++++++++ ism/src/isf_panel_agent_manager.h | 1 + 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp index 6e14dc3..722a267 100644 --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -1636,11 +1636,13 @@ private: Socket client_socket(client); m_send_trans.write_to_socket(client_socket); } -private: - static void send_fail_reply (int client_id) + void send_fail_reply (int client) { - Socket client_socket (client_id); + SCIM_DEBUG_MAIN(4) << __FUNCTION__ << " (" << client << ")\n"; + LOGD ("client id:%d\n", client); + + Socket client_socket (client); Transaction trans; trans.clear (); trans.put_command (SCIM_TRANS_CMD_REPLY); @@ -1648,6 +1650,8 @@ private: trans.write_to_socket (client_socket); } +private: + bool filter_event(int fd) { SCIM_DEBUG_MAIN(1) << "PanelAgent::filter_event ()\n"; diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 2d275cb..7b435dd 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -3561,9 +3561,12 @@ client context helpers: %d, helpers uuid count: %d", if (icit != m_start_helper_ic_index.end ()) { m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen); m_start_helper_ic_index.erase (icit); + result = true; + } else { + m_panel_agent_manager.send_fail_reply(client); } - - result = true; + } else { + m_panel_agent_manager.send_fail_reply(client); } } diff --git a/ism/src/isf_panel_agent_base.cpp b/ism/src/isf_panel_agent_base.cpp index 4a247c3..6605a95 100644 --- a/ism/src/isf_panel_agent_base.cpp +++ b/ism/src/isf_panel_agent_base.cpp @@ -575,6 +575,10 @@ void PanelAgentBase::set_prediction_allow (int client, uint32 context, String uu LOGW ("not implemented for %s", m_name.c_str ()); } +void PanelAgentBase::send_fail_reply (int client) +{ + LOGW ("not implemented for %s", m_name.c_str ()); +} } /* namespace scim */ /* diff --git a/ism/src/isf_panel_agent_base.h b/ism/src/isf_panel_agent_base.h index 36335e8..f5ae88e 100644 --- a/ism/src/isf_panel_agent_base.h +++ b/ism/src/isf_panel_agent_base.h @@ -924,6 +924,16 @@ public: * @return none. */ virtual void set_prediction_allow (int client, uint32 context, String uuid, int mode); + + /** + * @brief send_fail_reply. + * + * @param + * + * @return none. + */ + virtual void send_fail_reply (int client); + }; /** @} */ diff --git a/ism/src/isf_panel_agent_manager.cpp b/ism/src/isf_panel_agent_manager.cpp index 7ae0a51..e8c8482 100644 --- a/ism/src/isf_panel_agent_manager.cpp +++ b/ism/src/isf_panel_agent_manager.cpp @@ -902,6 +902,14 @@ void PanelAgentManager::set_prediction_allow (int id, uint32 context_id, String _p->set_prediction_allow (id, context_id, uuid, mode); } +void PanelAgentManager::send_fail_reply (int id) +{ + PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); + + if (!_p.null ()) + _p->send_fail_reply (id); +} + } /* namespace scim */ /* diff --git a/ism/src/isf_panel_agent_manager.h b/ism/src/isf_panel_agent_manager.h index f766a75..ba5d055 100644 --- a/ism/src/isf_panel_agent_manager.h +++ b/ism/src/isf_panel_agent_manager.h @@ -357,6 +357,7 @@ public: void remote_commit_string (int target_client, uint32 target_context, const WideString& wstr); void remote_delete_surrounding_text (int client, uint32 context_id, uint32 offset, uint32 len); void set_prediction_allow (int id, uint32 context_id, String uuid, int mode); + void send_fail_reply (int client); }; /** @} */ -- 2.7.4