• src/sbbs3/js_socket.c

    From deuce@VERT to CVS commit on Sunday, July 08, 2018 23:33:00
    src/sbbs3 js_socket.c 1.219 1.220
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv9539

    Modified Files:
    js_socket.c
    Log Message:
    Fix js_send() to conform to documentation.
    Also, is that some line ending weirdness? *shrug*



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Sunday, July 08, 2018 23:44:00
    src/sbbs3 js_socket.c 1.220 1.221
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv10801

    Modified Files:
    js_socket.c
    Log Message:
    Update documentation to match the behaviour... send() returns undefined,
    not null on failure.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, August 14, 2018 07:59:00
    src/sbbs3 js_socket.c 1.221 1.222
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv30001

    Modified Files:
    js_socket.c
    Log Message:
    The timeout parameter to js_socket_recv() is in seconds. I don't think
    Deuce really wanted to pass 1000 as a value here (use 1 instead). I don't
    know if this was an observable problem or not, but it certainly *looks*
    like a bug.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Tuesday, August 14, 2018 09:36:00
    src/sbbs3 js_socket.c 1.222 1.223
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv8154

    Modified Files:
    js_socket.c
    Log Message:
    Fix-up js_recvline() based on infinite error/log message report from Nelgin:
    term 0087 TLS ERROR 'Unexpected <Unknown type> (24) packet, expected application_data (23)' (-1) popping data
    message repeated 492 times: [ term 0087 TLS ERROR 'Unexpected <Unknown type> (24) packet, expected application_data (23)' (-1) popping data]

    When using TLS with a JS Socket object, if there was any kind of data error, the recvline() method would return a blank string rather than null/undefined. nntpservice.js just loops when it receives a blank string, so this caused an infinite loop (with disk-filling error log messages).

    First change: if no data has been received (i == 0) and there's any kind of receive error or timeout or disconnection, just return null. And not undefined, but null (!) like in v3.15 (before the great JS engine update of 2000-mumble). Also, there appeared to be a JS_RESUMEREQUEST call missing in the TLS error return case - so that's another bug fixed.
    Commented on the magic return values for js_sock_read_check()
    and js_socket_recv().
    Simplified js_sock_read_check() return value a tad: let the caller decide if they want to do something special based on the value of 'i'.
    Added some comments to make this code more readable.

    We are now no longer treating the different error return values (0 and -1) from js_socket_recv() special in this function, but we dont' treat them special in any of the other calls in this file/object either, so that seems to be the norm.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Al@VERT/TRMB to rswindell on Wednesday, August 15, 2018 03:36:00
    Re: src/sbbs3/js_socket.c
    By: rswindell to CVS commit on Tue Aug 14 2018 12:59 am

    The timeout parameter to js_socket_recv() is in seconds. I don't think Deuce really wanted to pass 1000 as a value here (use 1 instead). I don't know if this was an observable problem or not, but it certainly *looks* like a bug.

    I'm not sure if this was the target of your changes but the "timed out receiving packet data" errors are gone from binkit now.. :)

    Ttyl :-),
    Al


    ... Disclaimer: Advice void where prohibitted by common sense!

    ---
    þ Synchronet þ The Rusty MailBox - Penticton, BC Canada
  • From Digital Man@VERT to Al on Wednesday, August 15, 2018 18:39:00
    Re: src/sbbs3/js_socket.c
    By: Al to rswindell on Tue Aug 14 2018 08:36 pm

    Re: src/sbbs3/js_socket.c
    By: rswindell to CVS commit on Tue Aug 14 2018 12:59 am

    The timeout parameter to js_socket_recv() is in seconds. I don't think Deuce really wanted to pass 1000 as a value here (use 1 instead). I don't know if this was an observable problem or not, but it certainly *looks* like a bug.

    I'm not sure if this was the target of your changes but the "timed out receiving packet data" errors are gone from binkit now.. :)

    Huh. That might just be a coincidence? I don't see any correlation between that and my changes.

    digital man

    Synchronet/BBS Terminology Definition #59:
    XPDEV = Cross-platform Development
    Norco, CA WX: 84.2øF, 52.0% humidity, 3 mph SE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Al@VERT/TRMB to Digital Man on Wednesday, August 15, 2018 21:21:00
    Re: src/sbbs3/js_socket.c
    By: Digital Man to Al on Wed Aug 15 2018 11:39 am

    Huh. That might just be a coincidence? I don't see any correlation between that and my changes.

    I don't care for coincidences usually (in code) but this is a happy coincidence.. if it sticks.. :)

    Ttyl :-),
    Al


    ... Don't hate yourself in the morning; sleep till noon

    ---
    þ Synchronet þ The Rusty MailBox - Penticton, BC Canada
  • From Ragnarok@VERT/DOCKSUD to Al on Thursday, August 16, 2018 19:33:00
    El 15/08/18 a las 18:21, Al escribió:
    Re: src/sbbs3/js_socket.c
    By: Digital Man to Al on Wed Aug 15 2018 11:39 am

    Huh. That might just be a coincidence? I don't see any correlation between
    that and my changes.

    I don't care for coincidences usually (in code) but this is a happy coincidence.. if it sticks.. :)

    I still have it:

    8/16 12:30:23 evnt BINKPOLL Unconfigured address 510:771/1@justaxne
    8/16 12:30:23 evnt BINKPOLL Unconfigured address 510:5128/0@justaxne
    8/16 12:30:23 evnt BINKPOLL Unconfigured address 539:300/400@justaxne
    8/16 12:30:23 evnt BINKPOLL Adding outbound files for 4:902/27@fidonet
    8/16 12:30:23 evnt BINKPOLL Sending M_EOB command args:
    8/16 12:30:23 evnt BINKPOLL Sent M_EOB command
    8/16 12:30:23 evnt BINKPOLL Got M_FILE command args: FCD4FFE7.TH9 18007 1534437268 0
    8/16 12:30:23 evnt BINKPOLL Receiving file:
    /sbbs/temp/event/FCD4FFE7.TH9 (17.6KB)
    8/16 12:30:23 evnt BINKPOLL Got data frame length 4096
    8/16 12:30:23 evnt BINKPOLL Got data frame length 4096
    8/16 12:30:24 evnt BINKPOLL Got data frame length 4096
    8/16 12:30:24 evnt BINKPOLL Got data frame length 4096
    8/16 12:30:24 evnt BINKPOLL Got data frame length 1623
    8/16 12:30:24 evnt BINKPOLL Received file: /sbbs/temp/event/FCD4FFE7.TH9 (17.6KB)
    8/16 12:30:24 evnt BINKPOLL Moving '/sbbs/temp/event/FCD4FFE7.TH9' to '/sbbs/fido/inbound/FCD4FFE7.TH9'.
    8/16 12:30:24 evnt BINKPOLL Sending M_GOT command args: FCD4FFE7.TH9
    18007 1534437268
    8/16 12:30:24 evnt BINKPOLL Sent M_GOT command
    8/16 12:30:24 evnt BINKPOLL Timed out receiving packet data!
    8/16 12:30:24 evnt BINKPOLL Unlocking /sbbs/fido/outbound/0386001b.bsy.
    8/16 12:30:24 evnt BINKPOLL Touching semaphore file: /sbbs/data/fidoin.now
    8/16 12:30:24 evnt Timed event: BINKPOLL returned 0
    8/16 12:30:26 evnt Semaphore signaled for Timed Event: FIDOIN
    8/16 12:30:26 evnt Running native timed event: FIDOIN
    8/16 12:30:26 evnt FIDOIN Executing external: /sbbs/exec/sbbsecho -lesrby!
    8/16 12:30:26 evnt Timed event: FIDOIN returned 0

    ---
    þ Synchronet þ Dock Sud BBS TLD 24 HS - http://bbs.docksud.com.ar - telnet://bbs.docksud.com.ar
  • From echicken@VERT/ECBBS to Ragnarok on Thursday, August 16, 2018 19:00:00
    Re: Re: src/sbbs3/js_socket.c
    By: Ragnarok to Al on Thu Aug 16 2018 12:33:14

    8/16 12:30:24 evnt BINKPOLL Sent M_GOT command
    8/16 12:30:24 evnt BINKPOLL Timed out receiving packet data!

    This may not be an actual problem even though the log message looks alarming.

    In binkp.js -> BinkP.session there are situations where the timeout can be zero (seconds), so that the next attempt to receive a frame from the remote side will time out immediately (if there's no data waiting on the socket). The default 120 second timeout is used in other cases. Since there's no such delay in the timestamps from your log, I'd guess this is timing out immediately as designed.

    Whether it's a problem depends on whether these sessions are being terminated prematurely. If not, maybe the log output should be adjusted for this case so as not to cause concern.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Al@VERT/TRMB to Ragnarok on Thursday, August 16, 2018 18:44:00
    Re: Re: src/sbbs3/js_socket.c
    By: Ragnarok to Al on Thu Aug 16 2018 12:33 pm

    I still have it:

    8/16 12:30:24 evnt BINKPOLL Timed out receiving packet data!

    I haven't seen this here in a few days now. My error log was full of them but not now. Are you fully up to date? I suspect this is a normal thing as echicken suggests.

    I still see "We got an M_EOB, but there are still 1 files pending M_GOT" but then I see we get an M_GOT three lines below so I don't think those things are troublesome.

    Ttyl :-),
    Al


    ... Don't eat that. Studies prove it is hazardous to your health

    ---
    þ Synchronet þ The Rusty MailBox - Penticton, BC Canada
  • From Al@VERT/TRMB to Ragnarok on Monday, August 20, 2018 19:00:00
    Re: Re: src/sbbs3/js_socket.c
    By: Al to Ragnarok on Thu Aug 16 2018 11:44 am

    8/16 12:30:24 evnt BINKPOLL Timed out receiving packet data!

    I haven't seen this here in a few days now. My error log was full of them but not now. Are you fully up to date? I suspect this is a normal thing as echicken suggests.

    One of my links was on vacation for a time and now that he's back I see this too..

    Oops.. :)

    Ttyl :-),
    Al


    ... Captain, he's thinking about my breasts again! - Deanna Troy

    ---
    þ Synchronet þ The Rusty MailBox - Penticton, BC Canada
  • From rswindell@VERT to CVS commit on Monday, January 07, 2019 07:11:00
    src/sbbs3 js_socket.c 1.223 1.224
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv26303

    Modified Files:
    js_socket.c
    Log Message:
    Socket.connect() and .sendto() would not set Socket.error (aka last_error)
    when a host-name lookup (getaddrinfo call) failed.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, January 12, 2019 21:36:00
    src/sbbs3 js_socket.c 1.224 1.225
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_socket.c
    Log Message:
    Bug-fix: Socket.connect() would return true (success) even though a
    TCP connection actually failed. This bug only appeared to affect *nix
    systems. This bug appears to be very old, introduced in rev 1.74 of
    this file (Mar-2003) by yours truly.
    From the Linux 'connect' man page:
    EINPROGRESS
    The socket is nonblocking and the connection cannot be i
    completed immediately. It is possible to select(2) or poll(2)
    for completion by selecting the socket for writing. After
    select(2) indicates writability, use getsockopt(2) to read the
    SO_ERROR option at level SOL_SOCKET to determine whether
    connect() completed successfully (SO_ERROR is zero) or
    unsuccessfully (SO_ERROR is one of the usual error codes listed
    here, explaining the reason for the failure).

    We weren't doing the 'getsockopt(SO_ERROR)' part.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, August 04, 2019 20:10:26
    src/sbbs3 js_socket.c 1.230 1.231
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv28835

    Modified Files:
    js_socket.c
    Log Message:
    Added support for an IPv6 bool argument to the Socket() constructor:

    new Socket(true) // creates an IPv6 TCP socket
    new Socket(SOCK_STREAM, true) // creates an IPv6 TCP socket
    new Socket(SOCK_DGRAM, true) // creates an IPv6 UDP socket
    new Socket("myprot", true) // creates an IPv6 TCP socket named "myprot"



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, August 05, 2019 21:08:56
    src/sbbs3 js_socket.c 1.231 1.232
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv20435

    Modified Files:
    js_socket.c
    Log Message:
    Add new ConnectedSocket() and ListeningSocket() constructors.
    These have a large number of optional parameters, so these are placed in
    a separate argument as an object:

    ie: var s = new ConnectedSocket("synchro.net", "finger", {type:SOCK_DGRAM}); ie: var s = new ListeningSocket(["::","0.0.0.0"], "printer", "spooler", {retry_count:15});




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, August 05, 2019 22:08:50
    src/sbbs3 js_socket.c 1.232 1.233
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv28797

    Modified Files:
    js_socket.c
    Log Message:
    Allow specifying a bindport in the optional parameter object.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, August 05, 2019 23:32:40
    src/sbbs3 js_socket.c 1.233 1.234
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv6206

    Modified Files:
    js_socket.c
    Log Message:
    Add bindaddrs support to ConnectedSocket constructor.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, August 06, 2019 02:19:01
    src/sbbs3 js_socket.c 1.234 1.235
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv27102

    Modified Files:
    js_socket.c
    Log Message:
    Add a timeout (default 10) parameter to ConnectedSocket constructor




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, August 06, 2019 02:44:58
    src/sbbs3 js_socket.c 1.235 1.236
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv30261

    Modified Files:
    js_socket.c
    Log Message:
    Fix build on inferior operating systems.



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, August 06, 2019 03:58:37
    src/sbbs3 js_socket.c 1.236 1.237
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv6504

    Modified Files:
    js_socket.c
    Log Message:
    Fix typo.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Saturday, August 17, 2019 06:41:25
    src/sbbs3 js_socket.c 1.238 1.239
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv4842

    Modified Files:
    js_socket.c
    Log Message:
    Address msvc2019 warning C4018: '<': signed/unsigned mismatch



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Wednesday, August 21, 2019 01:45:21
    src/sbbs3 js_socket.c 1.239 1.240
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_socket.c
    Log Message:
    Fix typo in ListeningSocket constructor insufficient-args error:
    "At least two arguments required (interfaces, port, and protocol)"



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, August 27, 2019 07:07:07
    src/sbbs3 js_socket.c 1.241 1.242
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv21517

    Modified Files:
    js_socket.c
    Log Message:
    Don't close external sockets in finalize.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Monday, September 09, 2019 19:40:56
    src/sbbs3 js_socket.c 1.242 1.243
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv19634

    Modified Files:
    js_socket.c
    Log Message:
    Revision 1.242 prevented do_js_close() from being called in the finalize function for external sockets. However, service thrads that use TLS were relying on the finalize function to clean up the TLS session.

    Revert 1.242, and add a finalize parameter to do_js_close() which will only avoid the shutdown() call rather than completely avoid do_js_close() completely.

    This fixes a TLS session leak that would eventually prevent any new
    encrypted connections.




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From deuce@VERT to CVS commit on Tuesday, September 17, 2019 05:07:20
    src/sbbs3 js_socket.c 1.243 1.244
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv25856

    Modified Files:
    js_socket.c
    Log Message:
    Don't try to FD_SET() INVALID_SOCKET.
    Instead, just return -1 from js_socket_recv().




    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, August 09, 2020 01: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



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sunday, August 09, 2020 02: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.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Sunday, November 22, 2020 08: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.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thursday, November 26, 2020 20: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

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