uasync: pass socket name to all add_socket call sites

This commit is contained in:
evgeny committed 2026-09-20 01:13:38 +03:00
1 parent c36cebe357
commit b33caa56b8
31 files changed
+61 -59

No files matched your search

+2 -2
View File
@@ -799,7 +799,7 @@ static void accept_callback(socket_t fd, void* arg) {
cli->fd = cfd;
cli->hc = hc;
cli->socket_id = uasync_add_socket_t(hc->ua, cfd, client_read_callback, client_write_callback, NULL, cli);
cli->socket_id = uasync_add_socket_t(hc->ua, cfd, client_read_callback, client_write_callback, NULL, "chatctl_client", cli);
if (!cli->socket_id) { u_free(cli); socket_close_wrapper(cfd); DEBUG_ERROR((int)DEBUG_CATEGORY_HEADLESS, "headless: failed to register client fd"); return; }
cli->next = hc->clients; hc->clients = cli; hc->client_count++;
@@ -853,7 +853,7 @@ int chat_headless_control_init(struct UASYNC* ua, struct UTUN_INSTANCE* inst,
}
if (listen(hc->listen_fd, 5) < 0) { socket_close_wrapper(hc->listen_fd); hc->listen_fd = SOCKET_INVALID; return -1; }
hc->listen_sock_id = uasync_add_socket_t(ua, hc->listen_fd, accept_callback, NULL, NULL, hc);
hc->listen_sock_id = uasync_add_socket_t(ua, hc->listen_fd, accept_callback, NULL, NULL, "chatctl_listen", hc);
if (!hc->listen_sock_id) { socket_close_wrapper(hc->listen_fd); hc->listen_fd = SOCKET_INVALID; return -1; }
chat_event_set_handler(inst, hc_on_chat_event);