• src/sbbs3/js_socket.c

    From rswindell to CVS commit on Saturday, August 08, 2020 18:48:58
    src/sbbs3 js_socket.c 1.245 1.246
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_socket.c
    Log Message:
    New Socket class property: error_str
    text description of last socket error that occurred


  • From rswindell to CVS commit on Saturday, August 08, 2020 19:29:53
    src/sbbs3 js_socket.c 1.246 1.247
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv10376

    Modified Files:
    js_socket.c
    Log Message:
    Insure Socket.connect() sets the "error" property to a representative error value when the connection fails.
    Previously (on Windows), the "error" property would be set to 0 upon a connection failure.

  • From Rob Swindell to Git commit to sbbs/master on Sunday, November 22, 2020 00:14:40
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/ace3997a38743dbcb2f134bd
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Resolve gcc warnings about unused set variables.
  • From Rob Swindell to Git commit to main/sbbs/master on Thursday, November 26, 2020 12:28:01
    https://gitlab.synchro.net/main/sbbs/-/commit/30d409114d29f84fb93d59c8
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix bug with Socket.getoption() of byte-sized options

    Only observed on Windows, the option value variable (val) was uninitialized so querying byte-sized options using WinSock getsockopt() would leave the MSB of the value as undefined (garbage), resulting in sockinfo.js output like this:
    KEEPALIVE = -858993663
    instead of this:
    KEEPALIVE = 1
  • From Deuc╨╡ to Git commit to main/sbbs/master on Monday, February 15, 2021 21:32:41
    https://gitlab.synchro.net/main/sbbs/-/commit/a2a1448caeaf2b1a6add92e8
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Play this game.
  • From Rob Swindell to Git commit to main/sbbs/master on Monday, February 15, 2021 21:33:43
    https://gitlab.synchro.net/main/sbbs/-/commit/a6efc1beffc68abb0f64e23e
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Merge remote-tracking branch 'origin/master'
  • From Rob Swindell to Git commit to main/sbbs/master on Monday, February 15, 2021 21:59:14
    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.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Wednesday, March 17, 2021 10:46:53
    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.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Friday, April 02, 2021 12:45:49
    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
  • From Rob Swindell to Git commit to main/sbbs/master on Sunday, April 04, 2021 13:38:22
    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
  • From Rob Swindell to Git commit to main/sbbs/master on Sunday, April 04, 2021 15:13:57
    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
  • From Deuc╨╡ to Git commit to main/sbbs/master on Monday, April 05, 2021 23:05:29
    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()
  • From Rob Swindell to Git commit to main/sbbs/master on Wednesday, February 23, 2022 23:25:45
    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).
  • From Rob Swindell to Git commit to main/sbbs/master on Tuesday, October 04, 2022 14:28:50
    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.
  • From Rob Swindell to Git commit to main/sbbs/master on Monday, November 28, 2022 11:03:39
    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.
  • From Rob Swindell (on ChromeOS) to Git commit to main/sbbs/master on Saturday, May 27, 2023 12:47:08
    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
  • From Rob Swindell (on Windows) to Git commit to main/sbbs/master on Monday, July 24, 2023 17:21:26
    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.
  • From Rob Swindell (on Debian Linux) to Git commit to main/sbbs/master on Monday, July 24, 2023 18:27:43
    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.
  • From Rob Swindell (on Debian Linux) to Git commit to main/sbbs/master on Monday, July 24, 2023 18:29:00
    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).
  • From Rob Swindell (on Debian Linux) to Git commit to main/sbbs/master on Monday, July 24, 2023 18:33:53
    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().
  • From rickparrish to Git commit to main/sbbs/master on Wednesday, September 06, 2023 15:38:01
    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
  • From Rob Swindell to Git commit to main/sbbs/master on Wednesday, September 06, 2023 15:38:02
    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
  • From Rob Swindell (on Windows 11) to Git commit to main/sbbs/master on Tuesday, November 21, 2023 20:45:25
    https://gitlab.synchro.net/main/sbbs/-/commit/2baafdb0f202ef1367fe6794
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Limit JS Socket TLS error levels to "warning" severity

    Ideally, this would use startup.tls_error_level, but which one? And how?

    Also, make a TODO comment to fix the fact that all JS Socket log messages
    are logged to the terminal server log output. :-(
  • From Rob Swindell (on Windows 11) to Git commit to main/sbbs/master on Wednesday, November 22, 2023 15:47:10
    https://gitlab.synchro.net/main/sbbs/-/commit/f71b2650467aa655a44271ea
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Improve JS error reporting

    Include function names. Include host:port in "Unable to connect" error.
  • From Rob Swindell (on Windows 11) to Git commit to main/sbbs/master on Wednesday, November 22, 2023 15:55:13
    https://gitlab.synchro.net/main/sbbs/-/commit/13b07dbad2c77cef9f9f0aaf
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    __FUNCTION__ is not a string constant in GCC, so can't do this

    error: expected ‘)’ before string constant

    Harumph.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Wednesday, December 20, 2023 15:43:52
    https://gitlab.synchro.net/main/sbbs/-/commit/c9cb9c9cf9511b0f0ba29008
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Fix invalid pointer type waring (and bug)
  • From Deuc╨╡ to Git commit to main/sbbs/master on Wednesday, December 20, 2023 15:46:42
    https://gitlab.synchro.net/main/sbbs/-/commit/6aa310dfee947380e7513b35
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    get scfg from runtime before syncing cert
  • From Deuc╨╡ to Git commit to main/sbbs/master on Friday, January 19, 2024 20:43:37
    https://gitlab.synchro.net/main/sbbs/-/commit/242d088a8b7f6d2baa3c7569
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Ugh, spaces instead of tabs... so gross.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Friday, January 19, 2024 21:19:36
    https://gitlab.synchro.net/main/sbbs/-/commit/bebd0b64c36bccbc3f5d5cef
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Only tls servers should call destroy_session()

    TLS clients don't (currently) add a certificate, so there's no need
    to delete it.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Thursday, October 03, 2024 09:34:59
    https://gitlab.synchro.net/main/sbbs/-/commit/e67f51d0eaf484d995ade630
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Document the connect() callback thing.
  • From Rob Swindell (on Windows 11) to Git commit to main/sbbs/master on Saturday, November 09, 2024 20:30:54
    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.
  • From Deuc╨╡ to Git commit to main/sbbs/master on Monday, November 11, 2024 23:50:59
    https://gitlab.synchro.net/main/sbbs/-/commit/f4ea0c75823aafb6fa3d9da8
    Modified Files:
    src/sbbs3/js_socket.c
    Log Message:
    Document return values of Socket.poll()