etcp: replace connections linked-list with indexed ll_queue, add state/ref_count lifecycle
- Remove ETCP_CONN.next linked-list, UTUN_INSTANCE.connections list/count
- Unified connections in single ll_queue indexed by peer_node_id (0=pending)
- struct conn_queue_entry { peer_node_id, conn* } for uniform queue data
- Connection lifecycle via etcp.c: create→pending, conn_ready→indexed, close→detach+deferred free
- Close split: phase1 detach from external world, phase2 deferred via uasync_call_soon
- etcp_conn_set_peer_node_id: reindex on ID change (WARN)
- etcp_conn_ref_take/free: blocking close until refcount returns to 0
- Remove chat_connections — use unified connections queue directly
- Update all iteration/search patterns across 40 files (src + tests + chatgui)
This commit is contained in:
1 parent
6902f5fd95
commit
a7ecee01f5
40 files changed
+650
-449
No files matched your search
@@ -151,8 +151,11 @@ static void sleep_tb(int tb) {
|
||||
// ---- Condition functions ----
|
||||
static int cond_links_init(void) {
|
||||
if (!inst_a || !inst_b) return 0;
|
||||
struct ETCP_CONN* ca = inst_a->connections;
|
||||
while (ca) { struct ETCP_LINK* l = ca->links; while (l) { if (l->initialized) return 1; l = l->next; } ca = ca->next; }
|
||||
struct ll_entry* entry = inst_a->connections->head;
|
||||
while (entry) { struct conn_queue_entry* ce = (struct conn_queue_entry*)entry->data;
|
||||
struct ETCP_CONN* ca = ce->conn;
|
||||
struct ETCP_LINK* l = ca->links; while (l) { if (l->initialized) return 1; l = l->next; }
|
||||
entry = entry->next; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user