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 dfe0228..c72dff6 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 040ebcb..bc69307 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 6883ad0..8dbca3c 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 5b3d4ee..e53814c 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);