etcp: переупорядочить close + защита state==2 во всех API-точках; topo: правильная очистка group nodes и registry; chat/member: новый модуль member_sync; chatgui: обновления транспорта и UI

This commit is contained in:
evgeny committed 2026-08-09 12:39:53 +03:00
1 parent b2e4aadbf0
commit 7f901c01e1
38 files changed
+1275 -540

No files matched your search

+4 -16
View File
@@ -513,14 +513,7 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
}
queue_free(instance->tcp_connections); instance->tcp_connections = NULL;
while (instance->tcp_sockets) tcp_socket_remove(instance->tcp_sockets);
/* Drain deferred callbacks so stcp_link_close_impl runs before ETCP conn close */
{
int deferred_loops = 0;
while (instance->ua && instance->ua->immediate_queue_head) {
uasync_poll(instance->ua, 0);
if (++deferred_loops > 1000) { DEBUG_ERROR(DEBUG_CATEGORY_SYS, "[DESTROY] J: deferred loop stuck"); break; }
}
}
uasync_drain_immediate(instance->ua);
DEBUG_INFO(DEBUG_CATEGORY_SYS, "[DESTROY] J done — TCP");
/* Phase K: ETCP connections */
@@ -538,14 +531,9 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
queue_free(instance->connections); instance->connections = NULL;
DEBUG_INFO(DEBUG_CATEGORY_SYS, "[DESTROY] K done — connections");
/* Phase L: drain deferred + pings */
{
int deferred_loops = 0;
while (instance->ua && instance->ua->immediate_queue_head) {
uasync_poll(instance->ua, 0);
if (++deferred_loops > 1000) { DEBUG_ERROR(DEBUG_CATEGORY_SYS, "[DESTROY] L: deferred callback loop stuck"); break; }
}
}
uasync_drain_immediate(instance->ua);
/* Phase L: pings */
{
struct PING_CONTEXT* p = instance->pending_pings;
int pc = 0;