From fa5733b75417d87b0c42083414f650b4759cee7a Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Wed, 13 Feb 2019 13:59:45 +0900 Subject: [PATCH] Set each gdbus method call timeout as 5 seconds 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 --- client/src/pkgmgr_client_connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/pkgmgr_client_connection.c b/client/src/pkgmgr_client_connection.c index 6e1f2f2..914ccda 100644 --- a/client/src/pkgmgr_client_connection.c +++ b/client/src/pkgmgr_client_connection.c @@ -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]", -- 2.7.4