From 327aac1c12a67ec1036df09c10093da206f26115 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 10 Sep 2026 16:01:57 +0300 Subject: [PATCH] =?UTF-8?q?ncd:=20=D1=83=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D0=B5=20DEBUG?= =?UTF-8?q?=5FCATEGORY=5FDEBUG=20=D0=BB=D0=BE=D0=B3=D0=B8=20(scan=5Fconns,?= =?UTF-8?q?=20open/open=5Fnode=20dedup)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/transport_layer/node_conn_direct.c | 30 -------------------------- 1 file changed, 30 deletions(-) diff --git a/src/transport_layer/node_conn_direct.c b/src/transport_layer/node_conn_direct.c index dae191cd..5aa42eac 100644 --- a/src/transport_layer/node_conn_direct.c +++ b/src/transport_layer/node_conn_direct.c @@ -85,28 +85,6 @@ static void ncd_registry_remove(struct UTUN_INSTANCE* inst, struct ncd_entry* en while (*pp) { if (*pp == entry) { *pp = entry->next; return; } pp = &(*pp)->next; } } -/* TEMP DEBUG: сканирует inst->connections и выводит conn'ы с peer_node_id==node_id, - * которые instance_find_conn мог не вернуть (key=0 или дубликат ключа). */ -static void ncd_debug_scan_conns(struct UTUN_INSTANCE* inst, uint64_t node_id, const char* tag) { - struct ll_queue* q = inst->connections; - if (!q) { DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "[ncd] %s node=0x%016llx: connections=NULL", tag, (unsigned long long)node_id); return; } - int found = 0; - struct ll_entry* e = q->head; - while (e) { - struct conn_queue_entry* ce = (struct conn_queue_entry*)e->data; - if (ce && ce->conn && ce->conn->peer_node_id == node_id) { - DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, - "[ncd] %s node=0x%016llx: conn=%p [%s] state=%d qkey=0x%016llx links=%p up=%d init=%d", - tag, (unsigned long long)node_id, (void*)ce->conn, ce->conn->log_name, - ce->conn->state, (unsigned long long)ce->peer_node_id, (void*)ce->conn->links, - ce->conn->links_up, ce->conn->initialized); - found = 1; - } - e = e->next; - } - if (!found) DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "[ncd] %s node=0x%016llx: NO conn in queue", tag, (unsigned long long)node_id); -} - /* ═══════════ поиск узла ═══════════ */ /* * Загружает информацию об узле (адреса, pubkey) для создания линков. @@ -635,12 +613,6 @@ int node_conn_direct_open(struct UTUN_INSTANCE* inst, uint64_t node_id, return NCD_REUSED; } - if (conn) { - DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "[ncd] open node=0x%016llx: instance_find_conn=[%s] state=%d links=%p up=%d — NOT reused (state!=1), creating new", - (unsigned long long)node_id, conn->log_name, conn->state, (void*)conn->links, conn->links_up); - } - ncd_debug_scan_conns(inst, node_id, "open-new"); - /* 3. Новое подключение */ struct TOPO_NODE* ni = ncd_lookup_node(inst, node_id); if (!ni) { @@ -795,8 +767,6 @@ int node_conn_direct_open_node(struct UTUN_INSTANCE* inst, uint64_t node_id, return NCD_REUSED; }} - ncd_debug_scan_conns(inst, node_id, "open_node-new"); - /* 3. Новое подключение — используем переданный ni (временный, не владеем) */ { char conn_name[MAX_CONN_NAME_LEN]; if (ni->node_name && ni->node_name[0]) strncpy(conn_name, ni->node_name, MAX_CONN_NAME_LEN - 1);