• docs/v322_new.md src/sbbs3/telgate.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Friday, November 06, 2026 20:31:24
    https://gitlab.synchro.net/main/sbbs/-/commit/fc12511c119b01a78909deb7
    Modified Files:
    docs/v322_new.md src/sbbs3/telgate.cpp
    Log Message:
    Don't drop remote output in telnet_gate() when the output buffer is full

    RingBufWrite() stores only what fits in the ring buffer and returns that
    count. telnet_gate() ignored the return value, so once the 20000-byte
    outbuf filled (any time the remote host produced output faster than the
    user's connection drained it), whatever didn't fit was silently discarded.
    A door sending Sixel graphics over an rlogin gate to a SyncTERM user lost chunks mid-image.

    Now the gateway receives from the remote only as much as the output buffer
    can hold (half that when expanding LFs, since the expansion can double the data) and idles, still forwarding the user's keystrokes, when there is no
    room; TCP back-pressure then throttles the remote host. The local echo
    path waits for the output thread to make room rather than dropping too.

    Verified with a fake rlogin host blasting 240 KB at a deliberately slow
    telnet client: before, the stream diverged at byte 19999 and 147 KB never arrived; after, all 240 KB arrive intact, including with TG_ECHO (keys sent mid-stream) and TG_EXPANDLF.

    Fixes #1325

    Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)