• src/sbbs3/js_socket.c

    From Deucе@VERT to Git commit to main/sbbs/master on Mon Feb 15 21:32:41 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/a2a1448caeaf2b1a6add92e8
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Play this game.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Feb 15 21:33:43 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/a6efc1beffc68abb0f64e23e
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Merge remote-tracking branch 'origin/master'

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Feb 15 21:59:14 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4e9ff218de9f9656b2451ae5
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix apparent memory leak in js_listening_socket_constructor()

    The socket set allocated by xpms_create() was never freed. Found by Coverity.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Wed Mar 17 10:46:53 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/ec7f57ab985273580f085bbb
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Close Socket on unhandled TLS errors

    While errors on transmit seem to be handled well, errors on receive
    do not, especially through js_recv_line() which has been seen to
    trigger a large number (hundreds) of ECONNRESET errors. To prevent
    this, simply close the socket when an otherwise unhandled error
    occurs.

    Almost certainly fixes that issue, but the underlying cause is still undetermined. The calling script (imapservice.js) was checking Socket.is_connected after each recv_line() call, so if the socket
    was actually reset, it would be expected to only call it once.

    An alternative would be to explicitly handle the error that is
    seen (CRYPT_ERROR_PARAM1), but let's try a generic fix first and see
    of anything breaks because of it. Most likely issue would be an
    inability to recv() data after calling shutdown(), but I don't think
    many people do that except to move the TIME_WAIT to where they want
    it.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Fri Apr 2 12:45:49 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/8eaa996b9092487ed67eb428
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix Socket.connect()

    Broken with the poll() update

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 13:38:22 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4d23eff969882b00474af389
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix resource leaks caught by Coverity-scan

    CID 330950 and 319020

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 4 15:13:57 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/8e9b1273d3b896afc02f6180
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    printf fmt/argument type mismatches

    CID 319085 319089 319135 319142

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Mon Apr 5 23:05:29 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/7a8b54b954b6d0fbce888961
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix some bugs around sock.on('write'...) and sock.clearOn()

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Feb 23 23:25:45 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/4a50048e71c7c6d958acd428
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix invalid type in argument to printf format specifier

    CID 319135

    Fix the return value of js_socket_sendfilesocket() while we're here (off_t instead of int).

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Tue Oct 4 14:28:50 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f0127e9d4572f8c1c44536dc
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Check socket writability in JS Socket.send()

    BINKP is suddenly frequently hanging on sendsocket() on Vertrauen on Windows (sending files to my Z1 hub) so try this as a solution.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Mon Nov 28 11:03:39 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/3389aadcb8d3bcc3b428b993
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Revert "Check socket writability in JS Socket.send()"

    This reverts commit f0127e9d4572f8c1c44536dcda240c310e18f7d8.

    This change was "wrong-headed" per Deuce and broke JS sends on
    blocking sockets. Thanks for the help.

    This fix for inifinite-wait on send() likely led to the infinite
    BinkIT errors/log messages that led to commit 4dd32231.

    The real fix for this problem (which can block all other timed
    events from running), would be a Socket.poll() on the socket before
    send in binkp.js.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS)@VERT to Git commit to main/sbbs/master on Sat May 27 12:47:08 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ab4eca0e22c1c318db48edf6
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix misplaced JS_RESUMEREQUEST() - do thise *before* potential return

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Mon Jul 24 17:21:26 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/52d9a03d372792616091e4c6
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Apply socket options from sockopts.ini to sockets created by ListeningSocket()

    This socket constructor did not get the global socket options treatment when created (years ago).

    This should fix issue #402 as reported by Nelgin and more recently by Keyop.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Mon Jul 24 18:27:43 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/7ff687ff15f690410daa0bdb
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Revert "Apply socket options from sockopts.ini to sockets created by ListeningSocket()"

    This reverts commit 52d9a03d372792616091e4c66b28d98d711d3b29.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Mon Jul 24 18:29:00 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/99e8c77caf4a718768e80e6a
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Revert "Revert "Apply socket options from sockopts.ini to sockets created by ListeningSocket()""

    This reverts commit 7ff687ff15f690410daa0bdbe2ecc468ea1b4a41.

    We're already passing a sock_init callback (ls_cb) which is supposed to set
    the socket options (call set_socket_options), so this change shouldn't be necessary and reportedly caused more issues binding ircd sockets when running ircd.js via jsexec (though I didn't see this myself).

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Mon Jul 24 18:33:53 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/f9a44f56e2ad13a4373e63cd
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Manual revert of the ListeningSocket contructor "fix" which wasn't necessary

    I keep reverting/un-reverting the merge that includes an unrelated logon.cpp change. So just manually remove this new code that was added to attempt to
    fix issue #402 since I incorrectly concluded that sockopts.ini wasn't being applied to new sockets created with ListeningSocket().

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From rickparrish@VERT to Git commit to main/sbbs/master on Wed Sep 6 15:38:01 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/f07baf44425fdbee1059e2e5
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix return value when p->peeked is true

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Wed Sep 6 15:38:02 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/72d7a4904ccc668abc4dc3f5
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Merge branch 'Ree/js_socket_recv-fix' into 'master'

    Fix return value when p->peeked is true

    See merge request main/sbbs!328

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Thu Oct 3 09:34:59 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/e67f51d0eaf484d995ade630
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Document the connect() callback thing.

    ---
    ■ 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 Sat Nov 9 20:30:54 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f1cdaea3b87caa96bbf9b8c6
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Don't check recvline() timeout *before* checking if there's data to receive

    This was a regression: Socket.recvline() used to not care what the timeout duration was so long as there were bytes to receive.

    Also, remove the ".0" from timeout values in documented mehtods that don't
    (any longer) accept floating point timeout durations. We used to support fractional seconds for some of these methods, and that was implied by using
    the floating point default values, but that's no longer the case. poll()
    still accepts a floating point timeout.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Deucе@VERT to Git commit to main/sbbs/master on Mon Nov 11 23:50:59 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/f4ea0c75823aafb6fa3d9da8
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Document return values of Socket.poll()

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