Subj : js_socket: TLS send failures are indistinguishable from short writes To : GitLab note in main/sbbs From : Deucе Date : Sat Jul 25 2026 20:10:49 https://gitlab.synchro.net/main/sbbs/-/issues/1199#note_9712 A few comments on the issue description: > on a TLS session a caller cannot distinguish "connection closed" from "short write" Neither can the "Plaintext" socket object. > a routine client disconnect is indistinguishable from a real I/O error. In connected sockets, a routine client disconnect is distinguished by a recv(), not a send(). The remote *cannot* cleanly close the send side of the socket in this end, it can only indicate that is will send no more data. Only *non-routine* client disconnects are distinguished by send(). > js_sendbin() declares size_t wr (:1362). The -1 from the plaintext path already lands there as SIZE_MAX; the wr == (size_t)size test at :1401 then fails and the correct error path is taken — right answer, wrong reason. Make it ptrdiff_t. ptrdiff_t is for the result of subtracting two pointers, it is *not* a signed size type... we have ssize_t for that. --- SBBSecho 3.37-Linux * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705) .