diff --git a/src/evt_core.c b/src/evt_core.c index 297d479..1e7b728 100644 --- a/src/evt_core.c +++ b/src/evt_core.c @@ -65,6 +65,8 @@ void evt_core_add_cat(struct evt_core_ctx* ctx, struct evt_core_cat* cat) { } void evt_core_mv_fd(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct evt_core_cat* to_cat) { + printf("Moving fd=%d from cat=%s to cat=%s\n",fdinfo->fd, fdinfo->cat->name, to_cat->name); + // 1. Update old category for (int i = 0; i < fdinfo->cat->socklist->len; i++) { if (g_array_index(fdinfo->cat->socklist, struct evt_core_fdinfo*, i) == fdinfo) { @@ -143,14 +145,11 @@ struct evt_core_cat* evt_core_rm_fd(struct evt_core_ctx* ctx, int fd) { struct evt_core_fdinfo* fdinfo = g_hash_table_lookup (ctx->socklist, &fd); if (fdinfo == NULL) return NULL; cat = fdinfo->cat; + printf("Closing fd=%d from cat=%s\n",fdinfo->fd, fdinfo->cat->name); // 2. Update category for (int i = 0; i < cat->socklist->len; i++) { if (g_array_index(cat->socklist, struct evt_core_fdinfo*, i) == fdinfo) { - if (fdinfo->fd != fd) { - fprintf(stderr, "Logic error in updating file descriptor list\n"); - exit(EXIT_FAILURE); - } g_array_remove_index(cat->socklist, i); } }