• src/sbbs3/ftpsrvr.cpp js_socket.cpp mailsrvr.cpp main.cpp services.cpp

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Dec 3 19:26:30 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/8a1fa601266016f30bc5fee2
    Modified Files:
    src/sbbs3/ftpsrvr.cpp js_socket.cpp mailsrvr.cpp main.cpp services.cpp websrvr.cpp src/xpdev/multisock.c multisock.h
    Log Message:
    Count a listener closed by multisock itself as closed

    multisock calls the caller's sock_init callback, which counts the socket
    open (the socket_open startup callback, shown as "Sockets:" by sbbscon
    and the Control Panel), as soon as it creates a listening socket. The
    matching close callback was only ever passed to xpms_close() and xpms_destroy(), so a socket that multisock closed itself, never handing
    it to the caller, was counted open but not closed: a bind that failed
    for good, a listen() or out-of-memory failure after the bind, or a
    listener that "went bad" in xpms_accept(). Each left the count one high
    until the server stopped.

    struct xpms_set gains an optional sock_destroy callback (with its sock_destroy_cbdata), called for those sockets. The Terminal, Mail, FTP,
    Web and Services servers and JS ListeningSocket set it to the same
    callback they pass to xpms_close()/xpms_destroy().

    Fixes #1463

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net