https://gitlab.synchro.net/main/sbbs/-/commit/7440b2f2b9cfdd7b4d0ab3ad
Modified Files:
src/ssh/audit-design.md deucessh-conn.h ssh-conn.c ssh-internal.h src/ssh/test/test_chan.c
Log Message:
Fix audit items 4-5, 7-10 + event queue init + ZC window fix
Audit conformance fixes against design-channel-io-api.md:
- Item 4: term field changed from char[64] to char* with strdup
(no truncation, matches RFC 4254 unbounded string)
- Item 5: add dssh_chan_get_pty() returning const dssh_chan_params*
- Item 7: add cb_mtx per-channel mutex protecting callback pointers;
init/destroy in all channel lifecycle paths
- Item 8: in_zc_rx guard added to shutwr, close, send_signal,
send_window_change, send_break (was only on zc_getbuf/zc_send)
- Item 9: ZC callback WINDOW_ADJUST now sent (ZC mode only; stream
mode uses maybe_replenish_window after app reads)
- Item 10: dssh_session_set_event_cb stores in session struct,
propagated to channels at open/accept time
Additional fixes found during testing:
- Event queue initialized before channel registration in all three
open functions (dssh_chan_open, dssh_chan_zc_open, dssh_chan_accept)
to prevent SIGFPE when demux dispatches EOF/CLOSE during reject
- ZC WINDOW_ADJUST restricted to DSSH_IO_ZC (was firing for stream
mode too, breaking window accounting in demux truncation tests)
Remaining deliberate deviations documented in audit-design.md:
- Item 6: remote_window uses buf_mtx not atomic (correct, optimization)
- Item 11: design doc inconsistency in event position semantics
- Item 12: accept-loops-on-reject deferred (needs demux sync work)
Co-Authored-By: Claude Opus 4.6 (1M context) <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net