diff options
author | jusung <jusung07.son@samsung.com> | 2021-12-01 09:14:38 +0900 |
---|---|---|
committer | jusung <jusung07.son@samsung.com> | 2021-12-01 09:19:12 +0900 |
commit | 230a0ff94a472cdc7be699f0091ece7be2803e6d (patch) | |
tree | eef6ba7c439716e3383e0382006be92d858c1159 | |
parent | b4e0961ce19821b766e22a24d31efc9978a5924b (diff) | |
download | buxton2-230a0ff94a472cdc7be699f0091ece7be2803e6d.tar.gz buxton2-230a0ff94a472cdc7be699f0091ece7be2803e6d.tar.bz2 buxton2-230a0ff94a472cdc7be699f0091ece7be2803e6d.zip |
Fix cynara event handler
Even if the error of the socket fd is occurred, Buxton should call
the cynara_sync_process() function to process the cynara check requests.
Change-Id: I498c569b138bd93171881e9a0d45eec22837eae1
Signed-off-by: jusung <jusung07.son@samsung.com>
-rw-r--r-- | daemon/cynara.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/daemon/cynara.c b/daemon/cynara.c index 14a61b2..89bd6e3 100644 --- a/daemon/cynara.c +++ b/daemon/cynara.c @@ -93,28 +93,33 @@ static void free_cb(gpointer data) free(cyn_cb->key); free(cyn_cb); - bxt_dbg("Cynara: free %p", cyn_cb); + bxt_info("Cynara: free %p", cyn_cb); } static gboolean proc_cb(gint fd, GIOCondition cond, gpointer data) { int r; - if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { - cynara_fd_id = 0; - return G_SOURCE_REMOVE; - } + bxt_info("fd(%d), condition(%d)", fd, cond); r = cynara_async_process(cynara); if (r != CYNARA_API_SUCCESS) cyn_err("process", r); + if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { + cynara_fd_id = 0; + return G_SOURCE_REMOVE; + } + return G_SOURCE_CONTINUE; } static void status_cb(int old_fd, int new_fd, cynara_async_status status, void *data) { + bxt_info("old_fd fd(%d), new_fd(%d) cynara_async_status(%d)", + old_fd, new_fd, status); + if (old_fd != -1) { if (cynara_fd_id) { g_source_remove(cynara_fd_id); @@ -250,7 +255,7 @@ static enum buxton_cynara_res check_server(struct bxt_client *client, cyn_cb->priv = strdup(priv); g_hash_table_insert(cynara_tbl, GUINT_TO_POINTER(cyn_cb->id), cyn_cb); - bxt_dbg("Cynara: %p added", cyn_cb); + bxt_info("Cynara: %p added", cyn_cb); return BUXTON_CYNARA_UNKNOWN; } |