Used PING message to prevent deadlock 77/219577/1
authorInHong Han <inhong1.han@samsung.com>
Fri, 6 Dec 2019 07:46:01 +0000 (16:46 +0900)
committerInHong Han <inhong1.han@samsung.com>
Fri, 6 Dec 2019 07:46:01 +0000 (16:46 +0900)
Change-Id: I8ef985cca6deb54f0e1f2c72a6dccf33cab3d06e

ism/src/isf_message_queue.h
ism/src/scim_helper.cpp

index 15e6d92..ae595e0 100644 (file)
@@ -809,6 +809,10 @@ public:
         return (m_list_messages.size() > 0);
     }
 
+    int get_message_size() {
+        return m_list_messages.size();
+    }
+
     MessageItem* get_pending_message()
     {
         MessageItem* ret = NULL;
index 73f5faa..7876555 100644 (file)
@@ -2150,6 +2150,8 @@ HelperAgent::get_surrounding_text (int maxlen_before, int maxlen_after, String &
             m_impl->surrounding_text = NULL;
         }
 
+        LOGD("message_queue size : %d", message_queue.get_message_size());
+
         m_impl->send.clear ();
         m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST);
         m_impl->send.put_data(m_impl->magic_active);
@@ -2237,6 +2239,14 @@ HelperAgent::get_selection_text (String &text)
         free (m_impl->selection_text);
         m_impl->selection_text = NULL;
     }
+
+    LOGD("message_queue size : %d", message_queue.get_message_size());
+
+    m_impl->send.clear ();
+    m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST);
+    m_impl->send.put_data(m_impl->magic_active);
+    m_impl->send.put_command(SCIM_TRANS_CMD_PING);
+    m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active);
 }
 
 /**