Set timeout of dbus method call 59/240459/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 6 Aug 2020 08:29:00 +0000 (17:29 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Thu, 6 Aug 2020 10:23:52 +0000 (19:23 +0900)
Change-Id: I6b295d6ce80330db778aeceecfbb03025a50c4a7
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/theme/dbus/request_broker.cc

index f8d2622..6ff5ff2 100644 (file)
@@ -28,6 +28,7 @@ const char kDbusBusName[] = "org.tizen.ThemeManager";
 const char kDbusInterfaceName[] = "org.tizen.ThemeManager";
 const char kDbusObjectPath[] = "/org/tizen/ThemeManager";
 const char kDBusMethodSendData[] = "SendData";
+const int kTimeoutMsec = 60 * 1000;
 
 tizen_base::Bundle ErrorResultBundle() {
   tizen_base::Bundle b;
@@ -227,7 +228,7 @@ tizen_base::Bundle RequestBroker::SendData(Command cmd,
 
   GDBusMessage* reply = g_dbus_connection_send_message_with_reply_sync(
       connection_, msg, G_DBUS_SEND_MESSAGE_FLAGS_NONE,
-      -1, nullptr, nullptr, &err);
+      kTimeoutMsec, nullptr, nullptr, &err);
   if (reply == nullptr) {
     LOG(ERROR) << "g_dbus_connection_send_message_with_reply_sync() is failed";
     if (err) {
@@ -278,7 +279,7 @@ void RequestBroker::SendDataAsync(Command cmd, tizen_base::Bundle& data) {
   std::pair<Command, RequestBroker*> param = std::make_pair(cmd, this);
 
   g_dbus_connection_send_message_with_reply(connection_, msg,
-      G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, nullptr, nullptr,
+      G_DBUS_SEND_MESSAGE_FLAGS_NONE, kTimeoutMsec, nullptr, nullptr,
       [](GObject* source_object, GAsyncResult* res, gpointer user_data) {
         auto param =
             static_cast<std::pair<Command, RequestBroker*>*>(user_data);