evgeny
ae80dae8ee
tests: add Stage 7 merkle stress test — 13 instances, 5s spam, hash convergence
...
10 spammers (1-30ms random) + 2 observers (1-10ms), star topology via hub.
5s of concurrent modifications, then verify all 13 merkle root hashes
are identical and tree is internally consistent (recompute vs stored).
3 months ago
evgeny
d8921f0e3d
merkle_sync: fix infinite WAL growth from bg_check
...
- _recompute_bucket: skip INSERT OR REPLACE when hash unchanged,
also skip DELETE when row doesn't exist (was always writing)
- bg_check interval: 100ms → 5000ms (was writing 10x/sec × 4KB/page
into WAL = ~1.4GB over hours)
- bg_timer: round-robin across channels instead of only first
- bg_timer: periodic WAL checkpoint (every ~60s) to prevent
unbounded WAL growth from any source
- test: sync ms_session struct copy with real definition
- stcp_link: handle race where conn already CLOSED before close
- stcp_client: remove double-free c->free_on_close = cli
- etcp_connections: stcp_link_close on TCP link down
- u_async: round sub-ms timeouts to 1ms to avoid busy-loop
3 months ago
evgeny
9066ae6a1f
tests: add test_utils.h to git (was ignored by tests/test_* rule)
3 months ago
evgeny
6337d0f608
tests: add -I$(srcdir) to AM_CPPFLAGS for test_utils.h in VPATH builds
3 months ago
evgeny
4bb9f9e9c2
crypto: EVP_PKEY_generate → EVP_PKEY_keygen + OPENSSL_API_COMPAT для BSD/LibreSSL
3 months ago
evgeny
b2e4aadbf0
e2e: AES-128-CCM encryption via BGP router (ROUTER_FLAG_ENCRYPTED), ECDH key per peer-pair from NODEINFO pubkeys, cache 8 entries
...
- etcp_router.h/c: new flag ROUTER_FLAG_ENCRYPTED (0x04), etcp_route_send_encrypted(), inflight/retrans/send_q support
- utun_instance.h: e2e_ctx_cache[8] — per-peer sc_context_t cache with derived session key
- topo_node.c: topo_node_sign_self() — single point for Ed25519 self-signing of NODEINFO
- topo_node.c: fix stale x25519_self_sig after address update (topo_node_sign_self call)
- nat_detection.c: fix stale x25519_self_sig after in-place socket meta modification
- test_etcp_router_unit: 5 E2E tests (basic round-trip, no NODEINFO drop, tampered, cache reuse, ENCRYPTED+SIGNED combined)
- builds clean, 70/70 tests pass
3 months ago
evgeny
9846599086
stcp: fix memory leaks and cleanup architecture
...
- stcp_conn_do_close: always deferred free for allocated conns (was else-if)
- stcp_link_on_stcp_close: don't null link->conn (close_impl needs it for rx_queue)
- stcp_link_close_impl: free rx_queue/tx_queue before close, null conn after cleanup
- stcp_client_connect: return NULL on derive_session failure (was returning dead cli)
- stcp_frame_decrypt/stcp_recv_try: dedup CRC check into stcp_check_crc helper
- test_stcp: add test8_srv_recv_close (error-recv close chain)
3 months ago
evgeny
5c8355ee63
stcp: unified recv FSM, handshake timeout, RX backpressure, opaque pointer fix
...
- stcp_recv_try / stcp_recv_set: unified chunk reader with raw+stream modes
replacing duplicated stcp_conn_process_recv in server+client (~250 LOC removed)
- stcp_conn_read / stcp_conn_do_close / stcp_tx_queue_cb: unified shared functions
- continuous stream XOR: stcp_frame_encrypt now XORs len+data+CRC
- handshake timeout via uasync_set_timeout (5s server, 10s client)
- RX backpressure: stcp_rx_push / stcp_rx_resume_if_needed with hysteresis
- stcp_server_list_remove: new API fixes opaque pointer violation in auto_socket
and 4 double-free bugs on shutdown
- removed hs_expected_len/hs_key_processed fields (replaced by callback chain)
- removed recv_buf<4096 debug workaround
- stcp_try_send const fix (takes ownership of malloc'd data)
3 months ago
evgeny
ec9edb6a7c
Add test_etcp_link_stress: dynamic socket/link add/remove during traffic
...
- 2 instances, 1 initial UDP connection, 2000ms stress test
- Sends 1 packet every 1ms during stress
- Every 100ms: adds new UDP/TCP socket+link, removes oldest with stats
- Liveness check per cycle detects hangs
- Per-link report: type, state, decrypted/encrypted/acked bytes, retrans, RTT
- Removal stats: lifetime, encrypted, decrypted, acked, retrans, RTT, inflight
3 months ago
evgeny
d6c78d96c4
stcp: dedup encrypt/decrypt/send to stcp.c, add pending queue for buffering, add server pubkey verification, add 4MB bulk test
3 months ago
evgeny
38c9f229bc
stcp: ed25519 pubkey exchange in handshake, fix instance destroy segfault, fix chat_tcp_test
...
- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll
- stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close
- utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP),
add deferred drain in both Phase J and L
- stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39,
exchange ed25519_pubkey in both handshake directions
- etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in
etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb
- chat_sync.c: fix lk->conn NULL dereference for TCP links
- test_stcp.c: update stcp_server_create/stcp_client_connect callsites
- tools/chat_tcp_test: change transport udp→tcp
3 months ago
evgeny
a3783b5f55
fix: re-index conn_queue_entry after setting peer_node_id
...
tcp_server_on_link sets conn->peer_node_id after etcp_connection_create
which adds the entry with peer_node_id=0. instance_find_conn couldnt
find TCP connections until the queue entry was re-indexed.
3 months ago
evgeny
adac854c94
fix: TCP data flow — tx_state, keepalive, last_recv_local_time
...
- etcp_link_enter_ready_tcp: set tx_state=DATA_WAIT (was 0, blocking sends)
- etcp_conn_input: update last_recv_local_time on every packet (keepalive liveness)
- link_rx_cb: handle ETCP_KEEPALIVE before etcp_conn_input (conflicts with MEAS_RESP=0x08)
- KEEPALIVE handler: set recv_keepalive, remote_keepalive, link_status, keepalive_recv_count
- test_stcp_traffic: etcp_send instead of raw stcp_link_send
- test_etcp_stcp: rewrite for utun_instance + etcp_connect
3 months ago
evgeny
d773f1724a
refactor: STCP connections as ETCP links (is_tcp)
...
- Add is_tcp, tcp_link, tcp_reconnect_* fields to ETCP_LINK
- Remove transport_link from ETCP_CONN, add tcp_link_count
- stcp_link: replace embedded etcp_conn with pointer; add etcp_link backpointer
- stcp_link: link_rx_cb routes ETCP data to etcp_conn_input
- stcp_link: call on_close_cb in close
- New TCP functions: etcp_link_enter_ready_tcp, etcp_tcp_link_start_connect,
etcp_tcp_link_start_reconnect, tcp_link_close_cb, etcp_tcp_send
- etcp_link_new: handle NULL conn for TCP links; skip enter_init for TCP
- etcp_link_close: close stcp_link for TCP
- etcp_encrypt_send: redirect TCP to etcp_tcp_send (skips AES-CCM)
- tcp_server_on_link: create ETCP_LINK(is_tcp=1) + enter_ready_tcp
- etcp_connect: TCP addrs -> etcp_tcp_link_start_connect
- Remove ctx->tcp_link/tcp_ready
- test_stcp_traffic: find stcp_link via links->is_tcp instead of transport_link
- 66/68 tests pass; 2 STCP tests expected to fail (integration not complete)
3 months ago
evgeny
e51d8ddda2
chatgui: fix ERROR→WARN/DEBUG for normal situations
...
- member_sync apply_items: empty payload is normal sync completion, not error
- topo_node_sqlite node_load: no addresses is normal for stub/seed nodes
- conn_mgr_core: node skipped when not in routing (normal for nodes w/o addrs)
- topo_group send_nodeinfo: downgrade ERROR→WARN in DEBUG category
- db_sync INIT_RESP: protocol details belong in DEBUG, not INFO
3 months ago
evgeny
be0e76c9a6
debug: реорганизация категорий — SYS(1), ETCP(4) расширен, CONNECTION(3) очищен; fix stcp_client.c sock_err до connect()
...
Категории:
- DEBUG_CATEGORY_SYS=1: u_async + ll_queue + memory + timing (было 4)
- DEBUG_CATEGORY_ETCP=4: ETCP + normalizer + BBR (было 3)
- DEBUG_CATEGORY_CONNECTION=3: только события статуса линка/подключения (INFO)
- DEBUG_CATEGORY_KEEPALIVE=21: только периодический мониторинг (DEBUG)
- Удалены: NORMALIZER, BBR, CONNECTIVITY
- Устаревшие DB_SYNC → CHAT_SYNC + MEMBER_SYNC (предыдущий коммит)
CONNECTION+INFO — только: Connection UP/DOWN, Link UP/down, Link initialized/added,
NAT address init/changed, init server/client.
CONNECTION+DEBUG — retry, collision, reinit, socket register.
KEEPALIVE — init_timer SUPPRESSED, timer started, keepalive skipped.
REINIT — ETCP+INFO.
Connection status changed — GENERAL (пользовательский callback).
Dedup link_status: if(old_link_status) перед Link down.
Убран дублирующий Conn:%s из Link down, добавлен link_id в client added link.
Молчаливые ошибки: +DEBUG_ERROR в 15 местах (merkle_sync, member_sync, db_sync).
Fix: stcp_client.c — socket_get_error() вызывался ДО connect(), проверяя
застарелое errno вместо ошибки connect(). Неблокирующий connect() возвращает
-1+EINPROGRESS (норма), но сравнивался с мусором → ложный FAIL.
Все 4 STCP-теста исправлены (68/68 pass).
3 months ago
Evgeny
3b20c84c4d
mkdtemp: #ifdef _WIN32 в локальных обёртках, без test_utils.h
3 months ago
Evgeny
ebd975a03b
mkdtemp → test_mkdtemp из test_utils.h для кроссплатформенной сборки (MSYS2/MinGW)
3 months ago
Evgeny
98f3049e6b
mkdir → utun_mkdir в тестах для кроссплатформенной сборки (MSYS2/MinGW)
3 months ago
evgeny
de9e467b39
media_delivery: BLOCK_PROCESSING + relay streaming + per-file download limit
...
- block_availability: status column (0=processing, 1=completed)
- md_ba_complete_block(): DELETE old + check exists + INSERT new id
- BLOCK_PROCESSING subcmd (0x10) — INSERT with new id, no REPLACE/IGNORE
- BLOCK_RELAY_FULL subcmd (0x11) — redirect when source/relay at capacity
- relay_block_ctx: downstream forwarding from chunk file
- md_file_load: per-file source download limit (max_downloads_per_file)
- RELAY_FULL from source node when at capacity
- relay_full handler: retry existing peers, not just new ones
- sync.md: full documentation
3 months ago
evgeny
7263bdcf56
media_download tests: backpressure, block relay, OOB block_id, assembly
...
5 new tests in test_media_delivery_download:
- conn_cb starts only first block (backpressure)
- conn_cb with multiple peers
- BLOCK_DONE triggers next block relay from same peer
- assembly after all blocks validated
- peer with more blocks than dl (OOB fix verification)
md_dl_conn_cb made non-static for test visibility
md_dl_send added NULL guard for test instances without routing
media_download.h: added conn_cb extern declaration
3 months ago
evgeny
8023f6ee70
stcp: separate v4/v6 sockets, protocol byte in chat addr format, error on bind fail
...
- stcp_server_create: support AF_INET and AF_INET6 V6ONLY=1 (no dual-stack)
- Add listen_family to stcp_link_config
- init_sockets: return error (not partial) on any bind failure
- add chat_core_sync_my_addresses() call at chatgui startup
- collect_my_addrs: add proto byte (1=UDP, 2=TCP) to binary format
- chat_sync.c JOIN/WELCOME/PEER_UPSERT: read proto byte, write protocol column
- member_sync.c: read proto byte, dynamic protocol bind
- topo_node.c: debug logs for nodeinfo changed detection
- node_config.cpp: type=public for all servers
3 months ago
evgeny
c2191aad3b
chat: user-friendly INFO logs for invite/connect flow
...
- chat_sync.c: invite entry, JOINED/TIMEOUT messages
- conn_mgr_core.c: invite start (addrs+udp+tcp), NCD UP/DOWN/TIMEOUT,
TCP connect/ready/close, membership check send/receive/confirm/deny,
overall timeout
- node_conn_direct.c: NCD event names instead of numbers
3 months ago
evgeny
7799d54c0c
conn_mgr: обновить API на единую точку входа conn_mgr_open_invite, поправить порядок destroy, обновить всех потребителей
...
- conn_mgr_cb_t: 5 параметров (h, node_id, group_id, event, arg)
- conn_mgr_open_invite: единая функция (ni=NULL — обычное, ni!=NULL — invite)
- CONN_EVENT_JOIN для успешного invite
- struct CONN_MGR_HANDLE: добавлен group_id
- bind/unbind в conn_mgr_init/destroy (один на инстанс, перезапись безвредна)
- utun_instance_destroy: conn_mgr_destroy до закрытия сокетов
- cm_ncd_callback: занулять ncd_handle при DOWN, защита от вызова после destroy
- topo_group_connect: свой трекинг handle'ов, conn_mgr_close для отмены
- обновлены: topo_recovery, media_download, media_delivery, chat_sync, тесты
3 months ago
evgeny
625382de34
node_conn_direct: add specific_sock param, move registry to per-instance; expose sc_hex_to_binary; add CONFIG_CONN_HANDLE
3 months ago
evgeny
eb2a8f6975
node_conn_direct: add open_node variant, refactor internals
3 months ago
evgeny
153483fd96
media_delivery: обновление и новый тест conn_mgr_handles
3 months ago
evgeny
d310bccf08
fix: memory pool alloc mismatch in tests, db_sync SEND_DATA buffer overflow
...
- test_etcp_router_reconnect, test_etcp_connect, test_stcp_traffic:
replace u_calloc with memory_pool_alloc for TOPO_SOCKMETA4/TOPO_ADDR4
- db_sync.c: fix req[14] -> req[15] — SEND_DATA request header is 15 bytes
(type:1 + from:4 + count:2 + vp:4 + want_from:4)
3 months ago
evgeny
51d6c782ac
voice playback: miniaudio cursor ground truth + EMA smooth decay
...
- SoundManager: add currentPcmCursor()/isCurrentPcmPlaying() via ma_sound_get_cursor_in_pcm_frames / ma_sound_is_playing
- messagedelegate: replace wall-clock position tracking with real miniaudio cursor, remove 200ms hardcoded delay
- messagedelegate: end-of-playback detection via isCurrentPcmPlaying() instead of wall-clock comparison (was killing audio ~200ms early)
- messagedelegate: EMA smoothing of displayFrac/displayElapsed (0.15 factor, 16ms timer)
- messagedelegate: timer continues after audio stops to animate EMA decay to 0 (not mouse-move dependent)
- media_delivery: download progress callback, Ed25519 sig verify, author fallback, content hash check
- conn_mgr: already-connected returns OK with callback instead of error
- chatgui: voice download-pending auto-play, file download progress bar, media bar colors
3 months ago
evgeny
641c9f574f
db_sync: cascade insert + SYNC_DONE fixes + done_cbk + test stabilization
...
- db_record_insert_cascade: unified insert with on_insert + PUSH cascade
- SYNC_DONE moved from INIT_RESP to DATA handler (master sends after slave response)
- db_sync_add/remove_done_cbk: global sync-completion subscription (etcp pattern)
- REQUEST_SYNC handler: sync_state != 1 instead of == 0
- SYNC_DONE mc==pc hash mismatch: accept as converged
- Removed unconditional sync_state=2 from DATA handler
- test: done_cbk for sync phases, count-only for PUSH phases, removed dead B<>C reinitiate
3 months ago
evgeny
c093630d4d
db_sync: async batch chain_hash recalc (batch 50, timeout 0→100tb), flush before protocol chain_hash reads, remove db_cascade_from/range + do_cascade param
3 months ago
evgeny
70797f921e
feature: media auto-download + manual download + UI download state indication (Android + desktop)
...
C-layer:
- chat_event.h: CHAT_EVT_ATTACHMENT_DOWNLOADED (14)
- chat_msg.c: fixed md_auto_download (non-NULL done_cb, correct media_base from db_path, use chat_setting for autoload checks)
- chat_msg.c: added chat_core_attachment_download + trampoline for manual download
- chat_core.h: exported attachment_dl_req + trampoline
Android (Kotlin + JNI):
- Message: downloadState field (parse from localAttrs)
- ChatRepository: parse localAttrs for download state
- NativeLib: attachmentDownload() JNI
- MessageBubble: FileBubble with download status icon + tap-to-download
- ChatViewModel: downloadAttachment() + CHAT_EVT_ATTACHMENT_DOWNLOADED handler
- ChatScreen: wire onDownloadFile handler
- android_jni_bridge: utun_bridge_attachment_download + JNI + localAttrs in JSON
Desktop (Qt/C++):
- messagedelegate.h: MsgFileDownloadStateRole, MsgChannelIdRole
- messagelist.cpp: parse localAttrs for file download state
- messagedelegate.cpp: FileBubble with download icon/text + click handler via chat_core_attachment_download_trampoline
- gui_bridge.h: GUI_EVT_ATTACHMENT_DOWNLOADED (14) + callback typedef
- gui_bridge_impl.cpp: event dispatch + setter
- mainwindow.cpp: callback registration -> refresh message list
3 months ago
evgeny
b8920cf483
chat_settings: [chat] config section + live sync + fix test segfault
...
- New chat_setting.c/h: unified chat settings API (int/str getters)
- Config parser supports [chat] section, calls chat_setting_set per key
- chat_core exposes chat_core_set_setting / trampoline for GUI bridge
- chatgui: AudioDevice + Storage pages persist to [chat] config + live apply
- chatgui-android: ConfigProvider, NativeLib, headless handle chat settings
- MessageList: 200 msg limit, fixed saveChannelState via trampoline
- test_media_delivery_full: fix segfault at shutdown (mon() timer vs freed conns)
3 months ago
evgeny
efbb495016
media_delivery: fix SUPER_REPL spam + streaming verification
...
Bugs fixed:
- md_super_peer_add: timeout_tb = 0 → MEDIA_REPL_TIMEOUT_TB (timer fired every poll)
- md_repl_retrans_cb: md from peer->connect_timer (garbage) → peer->md
- md_repl_retrans_cb: removed inflight_count=0 reset (don't resend acked entries)
- stream_ctx: removed unused block_data field (was NULL, caused crash in BLOCK_DONE)
Test improvements:
- stream_completed flag for reliable streaming verification
- File created in <db_dir>/media/ (matches media_index path logic)
- 9/9 full test, 33/33 total
3 months ago
evgeny
b4824de3b8
media_delivery: fix streaming crash, correct file path via media dir
...
- Fix NULL block_data deref in stream_send_chunk_cb
- Test B1: create file in <db_dir>/media/, commit to media_files
- Store media_base in ui_state for streaming handler path resolution
- 8/9 tests pass (streaming works but timing issue with SUPER_REPL flood)
3 months ago
evgeny
a6321e15b3
media_delivery: streaming, fallback, admission control, 8/9 tests
...
- md_handle_block_req: real chunk streaming via etcp_router_on_send_ready
- stream_ctx state machine: backpressure waiter → send chunk → repeat
- content_hash + block_sig on stream completion
- Fallback to author when supernode has no block info
- media_download: author_node_id for peer fallback
- test_media_delivery_full: 8/9 pass (SUPER_HELLO, HAVE_BLOCK, replication, admission, file create)
- Known issue: streaming test hung (BGP route for n1→n2 not established in time)
3 months ago
evgeny
57e6ffed16
media_delivery: admission control + OVERLOADED + full integration test
...
- MEDIA_BLOCK_OVERLOADED (0x0F) subcommand + packed struct
- Admission control: track active_streams, reject > 3 with OVERLOADED
- media_delivery_stream_done() to decrement counter after stream finish
- Auto-download trigger in chat_msg.c (parse media metadata, check settings)
- test_media_delivery_full.c: 9/9 tests on 4 instances
(SUPER_HELLO, HAVE_BLOCK, replication, admission control, OVERLOADED)
- All 33 existing tests still pass (15+5+4+9)
3 months ago
evgeny
5e739176fa
media_delivery: fix etcp_route_send svc_id + integration test
...
Root cause: etcp_route_send reads dgram[0] as svc_id, not subcmd.
router_deliver prepends svc_id byte on receive.
Fixes:
- md_send/md_dl_send/msend: prepend ETCP_RT_ID_MEDIA_DELIVERY to dgram[0]
- md_etcp_recv: read subcmd from data[1] (was data[0])
- etcp_api.h: document dgram[0]=svc_id convention
- media_delivery_set_supernode(): public API for dynamic switching
Tests:
- test_media_delivery_integration: 4/4 (SERVE_REG, HAVE_BLOCK, supernode stop/start)
- All 24 existing tests still pass
3 months ago
evgeny
a863da7737
media_delivery: add tests + fix queue_new NULL ua and index_offset bugs
...
- test_media_delivery_sql: 15 tests (SQL tables, CRUD, packed structs)
- test_media_delivery_download: 5 tests (chunk write/append, sig verify, assembly, cancel)
- Fix: queue_new(NULL) returns NULL — pass inst->ua everywhere
- Fix: queue index offset must be offsetof(struct, key_field) not 0
- Move struct media_download to header for test visibility
3 months ago
evgeny
65dbfa6813
feat: media_async + media_index modules, media_files table, tests
...
- media_async: thread-per-task async engine with primitives (sha256, sign, copy, uuid, file_size)
- media_index: media_files DB table with register_async for indexing chunks
- chat_msg: async media submission via register_async, simplified chat_msg_submit fields
- voice_recorder/attachment_sender: write single file (no chunk splitting on caller side)
- inputbar/messagelist: updated to new simplified submit interface
- test_media_async: 4-thread stress test (200K ops / 2 sec, 0 errors)
- test_media_index: 9 cases covering commit edge cases + async flow
- build: Makefile.am, CMakeLists.txt, utun_sources.cmake updated
3 months ago
evgeny
ce5a84da24
fix: uasync epoll event ordering + test_uasync_socket_race fix
3 months ago
evgeny
90de87b13d
move audio_compressor from libutun_lite/ to lib/ — shared library
...
- audio_compressor.h/c moved to lib/ (alongside opus_codec, mem, debug_config)
- lib/Makefile.am: added to libuasync_a_SOURCES
- utun_sources.cmake: removed from _cfg_src (GLOB from lib/ picks it up)
- tests/Makefile.am: test_audio_compressor added to check_PROGRAMS
- test includes simplified (debug_config.h, mem.h — lib/ in include path)
3 months ago
evgeny
d22eac55f7
fix audio_compressor: flat array instead of ring buffer, +unit test (411 asserts)
...
Ring buffer (pending_head/pending_tail/cap) replaced with simple flat array (pending_count/cap).
u_realloc copies linearly but ring buffer needs memmove for wrap-around — mismatch caused
SIGSEGV write to 0x10 on ARM64. Flat array: append to end, process from [0], memmove down.
Performance unchanged (max ~15 blocks).
Tests: create/destroy, passthrough disabled, basic push+flush, silence, reset, stress (200 cycles)
3 months ago
Evgeny
d4a396f888
media: Ed25519-подписи блоков, local_attrs, MediaBlockReader, файловые вложения
3 months ago
Evgeny
ed6132fcda
перенос chat-логики из chatgui/transport в src/chat/
...
- Создан src/chat/ с chat_event.h/c — система нотификаций
- Перенесены chat_core, chat_msg, chat_channel, chat_profile, chat_status
- Перенесены chat_sync, member_sync, merkle_sync, db_sync
- gui_bridge_post() заменён на chat_event_post() с возможностью регистрации обработчика
- chat_event_set_handler() — chatgui регистрирует мост в gui_bridge
- Без обработчика: события логируются через DEBUG_DEBUG + log_dump
- chat интегрирован в utun_instance.c (при db_path в конфиге)
- Обновлены include-пути, Makefile.am, CMakeLists.txt
- Из chatgui удалены старые transport/ файлы, обновлён utun_node.cpp
3 months ago
Evgeny
4fde0b0325
feat: integrate Opus codec into lib/libopus + voice messages in chatgui
...
- Add lib/libopus/ (opus v1.6.1 embedded source: CELT 18 .c, SILK 77 .c, SILK float 28 .c, OPUS core 14 .c)
- Add lib/opus_codec.h/.c (wrapper: encoder, decoder, raw PCM int16)
- Add tests/test_opus_codec.c (7 tests: silence, sine, compression, PLC, null, defaults, multi-frame)
- chatgui: AudioRecorder (miniaudio capture, 48kHz mono)
- chatgui: VoiceEncoder (PCM→Opus file with custom container)
- chatgui: VoicePlayer (Opus→PCM playback via SoundManager)
- chatgui: PTT button in InputBar, voice message send/receive in MessageList
- chatgui: AudioDeviceSettingsPage (device selection, persisted in ui_state)
- chatgui: MessageDelegate voice message rendering (play button + duration)
- Update autotools: configure.ac, Makefile.am, src/Makefile.am, tests/Makefile.am
- Update CMake: chatgui CMakeLists.txt, libutun CMakeLists.txt (link libopus_internal.a)
3 months ago
Evgeny
ef1e064bdc
merkle_sync: broadcast relay for star topology + all 6 test stages pass
...
- Replace active/synced with sess_state (SESS_SYNCING/SESS_SYNCED)
- Add merkle_sync_broadcast() API for relaying changes to SYNCED peers
- apply_items callback now receives from_peer parameter
- _handle_hashes: reset pending_count on session reuse (overwrite fix)
- _handle_batch: send broadcast to synced sessions on new items
- Test Stage 5: sequential B->A + C->A with relay (no 3rd sync needed)
- Test Stage 6: cancel + start_overwrite pass
- Fix _wait_for: remove i_phase global timeout dependency
3 months ago
Evgeny
b9bde23d51
Stage 5 WIP: sequential syncs for 3-instance test, increased timeouts
3 months ago
Evgeny
a1ecab997e
merkle_sync: fix 4 protocol bugs + add test suite (Stages 1-4)
...
- g_merkle singleton → per-instance msync (utun_instance.h)
- level_prefix: off-by-one shift (63→64)
- _handle_hashes: differs |= for shared buckets with different hashes
- _handle_batch: sub_pl double-level-offset (next_lvl→lvl)
- pending[] array replaces pending_requests counter
- member_sync: mask_shift 63→64 alignment
- test_merkle_sync.c: prefix arithmetic, tree building, 2-instance integration, randomized 50-iter sync
3 months ago
Evgeny
27906e9f91
db_sync: односторонний sync, sparse-таблица, vp в SEND_DATA, PUSH-релей
3 months ago