auto_socket: TCP links support, chat_sync retry on socket change, link dedup by is_tcp

This commit is contained in:
evgeny committed 2026-08-11 18:57:24 +03:00
1 parent fec3ea38a7
commit d4a170b5c7
11 files changed
+945 -117

No files matched your search

+14
View File
@@ -653,6 +653,20 @@ void chat_sync_destroy(struct UTUN_INSTANCE* inst) {
u_free(cs);
}
void chat_sync_retry_channels_on_socket_change(struct UTUN_INSTANCE* inst) {
if (!g_cs || !g_cs->initialized || !inst->topo_groups) return;
for (int i = 0; i < g_cs->channel_count; i++) {
uint64_t gid = strtoull(g_cs->channels[i].channel_id, NULL, 10);
struct TOPO_GROUP* group = topo_groups_find(inst->topo_groups, gid);
if (!group || !group->connect) continue;
if (topo_group_connect_active_count(group) == 0) {
DEBUG_INFO(DEBUG_CATEGORY_MEMBER_SYNC, "%s: socket change — restarting connect for ch=%s (no active connections)",
CS_ID, g_cs->channels[i].channel_id);
topo_group_connect_restart(group);
}
}
}
void chat_sync_connect_node(struct UTUN_INSTANCE* inst, uint64_t node_id) {
(void)inst; (void)node_id;
}
+4
View File
@@ -108,6 +108,10 @@ void chat_sync_deny_invite(struct UTUN_INSTANCE* inst, uint64_t channel_id, uint
Канал (DB + TOPO_GROUP) создаётся локально при получении CHANNEL_INFO_RESP. */
void chat_sync_join_channel(struct UTUN_INSTANCE* inst, const char* ch_id, uint64_t target_node_id);
/* Перезапустить групповые подключения для каналов без активных соединений.
Вызывается из auto_socket при появлении/изменении сетевой связности. */
void chat_sync_retry_channels_on_socket_change(struct UTUN_INSTANCE* inst);
#ifdef __cplusplus
}
#endif