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
2 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)
2 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
2 months ago
evgeny
1dac0b8c81
unify compressor: remove C++ duplicate audiocompressor, use lib/audio_compressor.c in chatgui
2 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)
2 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)
2 months ago
evgeny
5b6979da27
android: voice messages recording + playback, file attachments
...
- C99 port of AudioCompressor (libutun_lite/audio_compressor.h/c)
- Voice recorder: PCM buffer + compressor + Opus encode + block splitting + uasync send
- Attachment sender: file splitting into blocks + uasync send
- Bridge API + JNI: voice start/feed/stop/cancel, attachment send, Opus decode for playback
- Kotlin: AudioRecorderManager (AudioRecord + JNI feed), AudioPlayer (AudioTrack + JNI decode)
- UI: PTT button with press-to-talk, attach button with file picker, recording overlay
- Message display: voice messages (play button), file attachments (icon + name)
- Settings: Opus preset selector (Low/Standard/High), compressor toggle
- AndroidManifest: RECORD_AUDIO, storage permissions
2 months ago