auto_socket: TCP links support, chat_sync retry on socket change, link dedup by is_tcp
This commit is contained in:
1 parent
fec3ea38a7
commit
d4a170b5c7
11 files changed
+945
-117
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user