https://gitlab.synchro.net/main/sbbs/-/commit/3cf61919e19595adf7612375
Modified Files:
src/sbbs3/js_socket.cpp js_socket.h
Log Message:
js: don't mark a TLS session drained while it holds a saved error
When cryptlib meets a fatal error after copying plaintext, the pop
returns that data with CRYPT_OK and reports the error on the next pop
only. It has already consumed the input, so the descriptor never
signals it. Since ab31f9f1c0 (2026-11-10) a short successful pop marked
the session drained, js_socket_tls_readable() stopped probing, and an event-driven reader was never told of the failure while the TCP
connection stayed open and idle (reported by Deuce on that commit).
Each pop begins by clearing the session's error message, so a message
present after a successful pop is that saved error: leave the session
undrained then, and the next probe finds it. Asking for the message
does no I/O, so a clean short read costs no extra wait.
Reproduced with a TLS 1.2 peer that sends data and a corrupt record,
or data and a close alert, in one write and keeps TCP open: a script
reading from a "read" callback got the data and nothing more for 8
seconds before, and is told about 2 ms after the data now. Built with
MSVC and GCC; the reproduction was run on the GCC build only.
Co-Authored-By: Claude Fable 5.2 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net