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
@@ -76,7 +76,7 @@ static udp_flow_t* create_flow(proxy_context_t* ctx, struct sockaddr_in* client)
baddr.sin_port = 0;
bind((int)flow->backend_sock, (struct sockaddr*)&baddr, sizeof(baddr));
flow->socket_id = uasync_add_socket_t(ctx->ua, flow->backend_sock, backend_read_cb, NULL, NULL, ctx);
flow->socket_id = uasync_add_socket_t(ctx->ua, flow->backend_sock, backend_read_cb, NULL, NULL, "udp_backend", ctx);
if (!flow->socket_id) {
socket_close_wrapper(flow->backend_sock);
u_free(flow);
@@ -202,7 +202,7 @@ int main(int argc, char* argv[]) {
DEBUG_ERROR(DEBUG_CATEGORY_SOCKET, "bind listen failed on %s:%d", ip, p);
return 1;
}
ctx.listen_id = uasync_add_socket_t(ctx.ua, ctx.listen_sock, client_read_cb, NULL, NULL, &ctx);
ctx.listen_id = uasync_add_socket_t(ctx.ua, ctx.listen_sock, client_read_cb, NULL, NULL, "udp_listen", &ctx);
} else if (strcmp(argv[i], "--target") == 0 && i+1 < argc) {
char ip[64] = {0}; int port = 0;
if (sscanf(argv[++i], "%63[^:]:%d", ip, &port) == 2) {