https://gitlab.synchro.net/main/sbbs/-/commit/6a90215fb1d8b41969c854f6
Modified Files:
src/sbbs3/js_socket.cpp
Log Message:
js: restore the socket's blocking mode after an asynchronous connect
The connect thread restored the caller's nonblocking setting by passing
the address of the one-byte bool in its argument block to ioctlsocket()
as a ulong. The read took in the padding and the port field behind it,
so the value was nonzero for any nonzero port and the socket was always
left nonblocking, whatever mode the script had set. A Socket.connect()
with a callback on a blocking socket therefore returned a nonblocking
one: send() of more than the kernel would buffer failed with EWOULDBLOCK instead of waiting.
Copy the flag into a ulong first. Dates from 1928973941 (2021-04-02).
Co-Authored-By: Claude Fable 5.1 <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net