https://gitlab.synchro.net/main/sbbs/-/commit/454cc802610dcfa661db6178
Modified Files:
src/sbbs3/main.cpp
Log Message:
Terminal server: apply the 8KB SSH send clamp that was never wired up
757e389522 (deputy-13-floating) limited cryptPushData() sends to 8KB in
both the web and terminal servers, after the same limit fixed a problem
in js_socket.c. The web server half took effect; the terminal server
half never did. output_thread() computed sendbytes and clamped it, then
called cryptPushData() with buftop - bufbot anyway, so the variable has
been dead ever since. Because the clamp expression reads sendbytes, no compiler warns about it.
Pass sendbytes to the push, as websrvr.cpp and sftp.cpp both already do.
Where getsockopt(TCP_MAXSEG) succeeds this changes nothing -- mss then
caps a linear-buffer read well below 8KB -- but where TCP_MAXSEG is
unavailable mss stays IO_THREAD_BUF_SIZE (20000) and pushes of up to
~20KB were bypassing the intended limit.
Hoist sendbytes to cover the whole send, so that it means "bytes offered
to the transport this iteration" for the sendsocket() path as well, and
key the short-send warning off it. Otherwise a clamped push would be
reported as a short send every time. The error paths that discard the
linear buffer ("pretend we sent it all") reset sendbytes to the full
remainder first, preserving their existing behavior of dropping it in
one go rather than in 8KB steps.
No functional change on this host, where TCP_MAXSEG is available.
Co-Authored-By: Claude Opus 4.8 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)