• src/ssh/deucessh.h ssh-conn.c ssh-trans.c ssh-trans.h

    From Deuc¨@VERT to Git commit to main/sbbs/master on Wed Apr 1 16:21:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/16c176989d30e9be671e9e18
    Modified Files:
    src/ssh/deucessh.h ssh-conn.c ssh-trans.c ssh-trans.h
    Log Message:
    Add optional scatter/gather TX callback for batched sends

    Factor tx_finalize into tx_finalize_prepare (padding, MAC, encrypt,
    advance tx_seq) and tx_update_counters, enabling preparation of
    multiple packets before a single I/O callback.

    New public API: dssh_transport_set_tx_gather() registers an optional
    callback that receives an iov array of wire-ready packet segments.
    When set, all TX paths (send_packet, zc_send_inner, send_to_slot, send_to_wa_slot) batch pending slot packets with the caller's data
    packet into a single gather call, enabling writev()-style sends.

    tx_gather_with_packet() is the shared internal helper: gathers up
    to DSSH_TX_IOV_MAX ready slot packets (session-priority, channel
    round-robin) plus one caller packet into a stack iov array, calls
    tx_gather, and signals cleared slots. Remaining slots beyond the
    iov limit stay ready for the next drain pass.

    Contract: callback returns 0 (all sent) or negative (error, unknown
    bytes on wire Ä session terminated). Backward compatible: NULL
    tx_gather preserves per-packet gconf.tx behavior unchanged.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net