Set each gdbus method call timeout as 5 seconds 59/199559/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 13 Feb 2019 04:59:45 +0000 (13:59 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 13 Feb 2019 04:59:45 +0000 (13:59 +0900)
The default timeout was 25 seconds, this is too long.
Now pkgmgr client API will have timeout as 25 seconds as maximum.
(5 sec * 5 times)

Change-Id: I4462181d067f44a26b3028e24dc9b3f412b7eaaa
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
client/src/pkgmgr_client_connection.c

index 6e1f2f2..914ccda 100644 (file)
@@ -31,6 +31,7 @@
 
 #define CONNECTION_RETRY_MAX 5
 #define CONNECTION_WAIT_USEC (1000000 / 2) /* 0.5 sec */
+#define CONNECTION_TIMEOUT_MSEC 5000 /* 5 sec */
 #define REGULAR_USER 5000
 
 static int _is_system_user(void)
@@ -280,7 +281,8 @@ int pkgmgr_client_connection_send_request(struct pkgmgr_client_t *pc,
                }
 
                r = g_dbus_proxy_call_sync(proxy, method, params,
-                               G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+                               G_DBUS_CALL_FLAGS_NONE,
+                               CONNECTION_TIMEOUT_MSEC, NULL, &error);
                g_object_unref(proxy);
                if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED) {
                        ERR("failed to send request, privilege denied[%s]",