https://gitlab.synchro.net/main/sbbs/-/commit/6bb7c593274fa21c88f360af
Modified Files:
src/sbbs3/js_global.cpp main.cpp services.cpp src/xpdev/ini_file.c multisock.c sockwrap.c sockwrap.h
Log Message:
xpdev: add SOCKET_STRERROR_BUFLEN, adopt at all socket_strerror() call sites
Define a recommended buffer length for socket_strerror() output in
sockwrap.h next to the SOCKET_STRERROR macro, so future call sites
have a discoverable, single-source-of-truth constant rather than
hand-picking a size each time:
#define SOCKET_STRERROR_BUFLEN 256
Replace the literal [256] (and the previously-fixed [128]) with this
constant at all 11 existing call sites:
xpdev/sockwrap.c retry_bind()
xpdev/multisock.c xpms_add(), read_socket()
xpdev/ini_file.c iniGetSocketOptions()
sbbs3/main.cpp output_thread()
sbbs3/services.cpp open_socket_cb(), close_socket(), cleanup(),
service_udp_sock_cb(), services_thread()
sbbs3/js_global.cpp js_system_get(), js_socket_strerror()
The value 256 is empirically sufficient for current Windows WSA error descriptions (the longest observed is WSAESHUTDOWN's localized text at
~135 bytes); a future bump for a longer message is now a one-line
change to the macro.
Co-Authored-By: Claude Opus 4.7 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net