Fix cynara event handler 56/267056/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 24 Nov 2021 22:43:45 +0000 (07:43 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 24 Nov 2021 22:43:45 +0000 (07:43 +0900)
Even if the error of the socket fd is occurred, AMD should call
the cynara_sync_process() function to process the cynara check requests.

Change-Id: I543adc25b362634ec1253e6a4293fa31bca28755
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/modules/cynara-core/src/amd_cynara_core.c

index bf81a68..630c936 100644 (file)
@@ -156,7 +156,7 @@ static void __resp_cb(cynara_check_id id, cynara_async_call_cause cause,
        struct caller_info *info = (struct caller_info *)data;
        char *privilege;
 
-       _D("check id %u, cause %d, resp %d", id, cause, resp);
+       _W("check id %u, cause %d, resp %d", id, cause, resp);
 
        privilege = g_hash_table_lookup(info->id_table,
                        GUINT_TO_POINTER(id));
@@ -212,6 +212,8 @@ static enum amd_cynara_result __check_server(struct caller_info *info,
                return AMD_CYNARA_RET_ERROR;
        }
 
+       _W("[__CYNARA__] cynara_check_id(%u), user(%s|%s|%s), privilege(%s)",
+                       id, info->client, info->session, info->user, privilege);
        g_hash_table_insert(info->id_table, GUINT_TO_POINTER(id),
                        strdup(privilege));
 
@@ -515,15 +517,16 @@ static gboolean __proc_cb(gint fd, GIOCondition cond, gpointer data)
 {
        int ret;
 
+       _W("[__CYNARA__] fd(%d), GIOCondition(%d)", fd, cond);
+       ret = cynara_async_process(r_cynara);
+       if (ret != CYNARA_API_SUCCESS)
+               _E("process error %d", ret);
+
        if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
                cynara_fd_id = 0;
                return G_SOURCE_REMOVE;
        }
 
-       ret = cynara_async_process(r_cynara);
-       if (ret != CYNARA_API_SUCCESS)
-               _E("process error %d", ret);
-
        return G_SOURCE_CONTINUE;
 }