• src/xpdev/sockwrap.c

    From Deucе@VERT to Git commit to main/sbbs/master on Thu Jan 2 10:25:53 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/dc6a8901e1b62a031afb399a
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    Some more Coverity paranoia.

    This ones does require SSIZE_MAX... so let's see what the pipes say...

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Thu Jan 2 10:31:21 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/8b8e70ac870bb4dd29dc7e85
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    Actually we only need to not pass rd, SSIZE_MAX doesn't matter

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Fri Jan 3 01:38:06 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/2f78d96038cd3ce3581b75da
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    Bring some sanity to sendfilesocket()

    Not that there's any need to, it appears that it was written for
    the web server, then discarded for that purpose and now is only
    called from the JS Socket.sendfile() method, which always passes
    NULL and 0 for the last two parameters, and has a copy/pasted
    implementation for TLS sockets. The only consumer of that in
    the tree appears to be gopher_service.js.

    It was apparently to use as a wrapper for the high-performance
    FreeBSD sendfile(), but that code behaved differently than all
    the other platforms, and was disabled (behind USE_SENDFILE, which
    isn't defined anywhere).

    This should really just be folded into either js_socket_sendfilesocket()
    or js_sendfile() with the extra knobs broken off and all the TODO
    comments I'm adding here addressed.

    Though, since Socket.sendfile() returns a bool where true indicates
    that either the size of the file at the start of the function
    was sent, or an EOF was reached, and false indicates that
    "something else happened", some of the TODO comments don't really
    need to be addressed.

    Basically, this is a crap function and it's only used by an even
    more crap JS wrapper, it should be tucked into a backward
    compatibility function, removed from the JSDocs, and forgotten
    about.

    If Coverity keeps complaining about this, I'll wait until after
    the next release and drag this out back and shoot it. Otherwise,
    I'll just forget it ever existed.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Fri Jan 3 08:59:56 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/8c4af199650226fd7a11fd74
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    *Sigh* Borland.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Mar 2 22:42:57 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/2773f92cddcec6b459d6a17b
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    nonblocking_connect() must return non-zero upon failure to connect

    on Windows, after the call to the socket_writable() timed out (failed)
    calling getsockopt(... SO_ERROR ...) was setting the result to 0, indicating a successful connection.

    So if getsockopt() reports the socket errno value is 0, don't use that value for the result, default to ETIMEDOUT (60) instead.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Mar 2 22:53:57 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/05695d68d4d420b7b2f00dbc
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    Fix Borland C compile error

    Yup, still using ancient tools to build xpdev

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Mar 2 23:05:36 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f0faf99aab62e7855c5de682
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    Minimize the diff of these last couple of commits to nonblocking_connect()

    No functional change.

    We're not retaining the original conect() error value, so don't need the new/additional variable (and associated line changes).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Tue Mar 3 12:55:09 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/e77ef308c29867a147afce0e
    Modified Files:
    src/xpdev/sockwrap.c
    Log Message:
    getsockopt(... SO_ERROR...) should be called when writable

    Commit 01fc91c816 reversed this logic.

    Leaving the getsockopt() in the failure case for now in case the
    wirder range of results is useful somehow.

    ---
    ï¿­ Synchronet ï¿­ Vertrauen ï¿­ Home of Synchronet ï¿­ [vert/cvs/bbs].synchro.net