Fix dbus delay when requesting hello 77/185377/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Mon, 30 Jul 2018 05:47:53 +0000 (14:47 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Mon, 30 Jul 2018 05:47:53 +0000 (14:47 +0900)
Change-Id: I376556d68ed3d1a3b6ad2ab59830d91aaeb5e46d
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
client/vc_dbus.c
client/vc_mgr_dbus.c
client/vc_widget_dbus.c
server/vcd_dbus.c

index dfe02281d5f492e5862af4b186d2c97eeb6dec7f..c72dff6dd40926c8572eec1c2887fbd5b20fcbbc 100644 (file)
@@ -402,7 +402,7 @@ int vc_dbus_request_hello()
        DBusMessage* result_msg = NULL;
        int result = 0;
 
-       result_msg = dbus_connection_send_with_reply_and_block(g_conn_sender, msg, 500, &err);
+       result_msg = dbus_connection_send_with_reply_and_block(g_conn_sender, msg, -1, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_DEBUG, TAG_VCC, "[ERROR] Dbus Error (%s)", err.message);
index 040ebcb407fab5519e26433049e8078e56bca3ae..bc69307e5300a0c40a81a40db3461cd70c5441dc 100644 (file)
@@ -842,7 +842,7 @@ int vc_mgr_dbus_request_hello()
        DBusMessage* result_msg = NULL;
        int result = 0;
 
-       result_msg = dbus_connection_send_with_reply_and_block(g_m_conn_sender, msg, 500, &err);
+       result_msg = dbus_connection_send_with_reply_and_block(g_m_conn_sender, msg, -1, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_DEBUG, TAG_VCM, "[ERROR] Dbus Error (%s)", err.message);
index 6883ad03e440b4c23bc152b641fa031381949f43..8dbca3c8cc86605d2b46ff1a0c18f1d1f63a8dd7 100644 (file)
@@ -485,7 +485,7 @@ int vc_widget_dbus_request_hello()
        DBusMessage* result_msg = NULL;
        int result = 0;
 
-       result_msg = dbus_connection_send_with_reply_and_block(g_w_conn_sender, msg, 500, &err);
+       result_msg = dbus_connection_send_with_reply_and_block(g_w_conn_sender, msg, -1, &err);
 
        if (dbus_error_is_set(&err)) {
                if (!strncmp(err.name, DBUS_ERROR_SERVICE_UNKNOWN, strlen(err.name)))
index 5b3d4ee9f7b445b351cacb1d2cecc935af0b6479..e53814c2bf2de090b2bb0447702b723f5847367d 100644 (file)
@@ -1250,6 +1250,11 @@ int vcd_dbus_open_connection()
                return VCD_ERROR_OPERATION_FAILED;
        }
 
+       /* Flush messages which are received before fd event handler registration */
+       while (DBUS_DISPATCH_DATA_REMAINS == dbus_connection_get_dispatch_status(g_conn_listener)) {
+               listener_event_callback(NULL, NULL);
+       }
+
        /* add a rule for getting signal */
        char rule[128];
        snprintf(rule, 128, "type='signal',interface='%s'", VC_SERVER_SERVICE_INTERFACE);