https://gitlab.synchro.net/main/sbbs/-/commit/957616f7caac7fecb344fc43
Modified Files:
src/ssh/audit-design.md design-channel-io-api.md ssh-conn.c ssh-internal.h src/ssh/test/dssh_test.h mock_io.c test_algo_enc.c test_algo_key.c test_algo_mac.c test_alloc.c test_auth.c test_chan.c test_conn.c test_selftest.c test_thread_errors.c test_transport.c test_transport_errors.c
Log Message:
Fix audit items 6, 11 + test reliability under contention
Item 6: remote_window converted to atomic_uint_least32_t with CAS
saturating add/sub helpers. zc_send_inner no longer acquires buf_mtx
for the window deduction.
Item 11: design doc event positions corrected to "bytes of unread
stdout/stderr at poll time"; poll freeze path recomputes from .used.
Test fixes:
- 20 test_server_send_fail_* tests: close both pipes before thrd_join
to prevent hang when server send wins the race and loops to recv
- 3 dclient server threads: close_s2c_write (not full close) to avoid
yanking the read fd from under the client thread
- Selftest/conn accept+poll timeouts: 5s -> 30s, poll loops 100-200ms
-> 1000ms to survive -j16 contention with PQ/DH-GEX crypto
- EINTR retry on all socket send/recv in test_selftest.c and mock_io.c
- After-each cleanup hook in test framework: selftest registers
g_active_ctx so leaked demux/accept threads from ASSERT bail-outs
get cleaned up before the next test runs in the same process
Co-Authored-By: Claude Opus 4.6 (1M context) <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net