Include admission in minimal media replication schemas

This commit is contained in:
evgeny committed 2026-11-03 16:36:38 +01:00
1 parent 9700ea3340
commit f3fb1c64ac
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -80,8 +80,8 @@ static void add_announcement_group(struct UTUN_INSTANCE* inst, uint64_t id) {
snprintf(g->channel_id, sizeof(g->channel_id), "%llu", (unsigned long long)id);
queue_data_put_with_index(inst->topo_groups->group_list, e);
char command[512];
snprintf(command, sizeof(command), "CREATE TABLE peers_%s(node_id INTEGER PRIMARY KEY,adm_tags TEXT);"
"INSERT INTO peers_%s VALUES(256,'{}'),(512,'{\"supernode\":\"yes\"}')", g->channel_id, g->channel_id);
snprintf(command, sizeof(command), "CREATE TABLE peers_%s(node_id INTEGER PRIMARY KEY,adm_tags TEXT,admitted INTEGER DEFAULT 1);"
"INSERT INTO peers_%s(node_id,adm_tags) VALUES(256,'{}'),(512,'{\"supernode\":\"yes\"}')", g->channel_id, g->channel_id);
sql(inst->topo_sqlite_db, command);
}
+2 -2
View File
@@ -69,8 +69,8 @@ static void add_group(struct UTUN_INSTANCE* inst, uint64_t group) {
snprintf(g->channel_id, sizeof(g->channel_id), "%llu", (unsigned long long)group);
queue_data_put_with_index(inst->topo_groups->group_list, e);
char command[512];
snprintf(command, sizeof(command), "CREATE TABLE peers_%llu(node_id INTEGER PRIMARY KEY,adm_tags TEXT);"
"INSERT INTO peers_%llu VALUES(256,'{\"supernode\":\"yes\"}'),(512,'{\"supernode\":\"yes\"}'),(768,'{\"supernode\":\"yes\"}')",
snprintf(command, sizeof(command), "CREATE TABLE peers_%llu(node_id INTEGER PRIMARY KEY,adm_tags TEXT,admitted INTEGER DEFAULT 1);"
"INSERT INTO peers_%llu(node_id,adm_tags) VALUES(256,'{\"supernode\":\"yes\"}'),(512,'{\"supernode\":\"yes\"}'),(768,'{\"supernode\":\"yes\"}')",
(unsigned long long)group, (unsigned long long)group);
sql(inst->md.db, command);
}