Added to send fail_reply message in the panel_agent's socket communication. 65/110165/1
authorWonkeun Oh <wonkeun.oh@samsung.com>
Fri, 13 Jan 2017 05:41:58 +0000 (14:41 +0900)
committerWonkeun Oh <wonkeun.oh@samsung.com>
Fri, 13 Jan 2017 06:26:08 +0000 (15:26 +0900)
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

ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp
ism/src/isf_info_manager.cpp
ism/src/isf_panel_agent_base.cpp
ism/src/isf_panel_agent_base.h
ism/src/isf_panel_agent_manager.cpp
ism/src/isf_panel_agent_manager.h

index 6e14dc301d857f5937c31386e92c2288818b3df8..722a267c1b0bb609078da5eded1eccabca66328f 100644 (file)
@@ -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";
 
index 2d275cb2ac3e51c4b4d45e2b3db5d20e15ed8b3c..7b435dd566e67fb7e40f9a457cbfe94c214bbb4e 100644 (file)
@@ -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);
             }
         }
 
index 4a247c349578a5e728254063748e8c1541fafd2a..6605a9501a8f11da61ad47eb620eda35fbd80383 100644 (file)
@@ -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 */
 
 /*
index 36335e8428375fc30bf4193aade1ae1c755a4e00..f5ae88e4def76818192e12309c29001a807c4c30 100644 (file)
@@ -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);
+
 };
 
 /**  @} */
index 7ae0a5173203d45315c276c24f3f589f792cf47a..e8c84828e5af65c02928b4e589e0634e820ddffc 100644 (file)
@@ -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 */
 
 /*
index f766a7543606f55f5764a45714ce7bde89457cdb..ba5d05586006e303296d5f5356932e9330d61189 100644 (file)
@@ -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);
 };
 
 /**  @} */