1. 13 Apr, 2020 1 commit
    • deuce's avatar
      Check if TCP timestamps are enabled, and if they are, subtract 12 from the · 7a6e1b5c
      deuce authored
      MSS for the packet size.
      Fixes problem with telnet server where large transfers were full packets
      followed by a 12 byte packet.  Also removes hack in webserver that always
      assumed timestamps were enabled.
      The Win32 code has not been tested, but is assumed to work perfectly.
  2. 11 Apr, 2020 1 commit
    • rswindell's avatar
      Two unrelated changes, but since they touched sbbs.h, I'm committing them · 0d73dbc4
      rswindell authored
      together to keep things atomic:
      1. Eliminate eprintf() as sbbs_t::lputs() and sbbs_t::lprintf() do the
         "right thing" (e.g. log to the event log when called from the event_thread).
      2. Moved upload_stats() and download_stats() from ftpsrvr.c to getstats.c where
          I plan to make use of them for JS-based upload/download file support.
  3. 19 Mar, 2020 1 commit
    • rswindell's avatar
      Added usernum member to client_t which tracks if the client_t.user (name) · 570a9466
      rswindell authored
      is actually an authenticated local user (when usernum != 0).
      msg_client_hfields() no longer saves the client->user as the SMB SENDERUSERID
      hfield when the client hasn't been authenticated (as is the case with normal
      SMTP). The SENDUSERIDs were redundant and misleading for unauthenticated
      SMTP-received mail messages, so that's now fixed.
  4. 02 Feb, 2020 1 commit
  5. 20 Dec, 2019 1 commit
  6. 24 Oct, 2019 1 commit
    • rswindell's avatar
      Invoking a JavaScripot global hot key event handler (e.g. nodelist.js) *while* · c912ee30
      rswindell authored
      running a JavaScript module would crash (e.g. segfault) sbbs:
      Create and use a separate JS runtime, context, and global object/scope for
      global hotkey events. This means that the hotkey won't benefit from any
      previously loaded/required scripts, possibly effecting the performance of the
      first invocation of the hotkey handler. Subsequent JS hotkey events will reuse
      the same runtime/context/global, so they'll execute fast(er).
      One questionalbe change to js_execfile():
      With the JS_GC (garbage collection) call *before* the JS_ENDREQUEST() call, the
      process would crash in libmozjs. Moving the JS_GC() call to *after* the
      JS_ENDREQUEST() resolved this issue and I'm not clear why. This 'js_cx'
      parameter here is not always sbbs_t::js_cx. When called to handle a JS hotkey
      event, it's sbbs_t::js_hotkey_cx, so it shouldn't interfere with the
      sbs_t::js_cx being used by the currently executing JS module (shell or door).
      <scratches chin>
  7. 23 Sep, 2019 1 commit
    • rswindell's avatar
      This change goes with the previous commit to scfglib2.c (with no commit msg): · 05720ed9
      rswindell authored
      Address problem reported by Mark Lewis:
      If a timed event is configured to both run "exclusively" and on "Any" node,
      then any nodes in use at the time of the event would get their status changed
      to waiting-for-connection (WFC) and it could actually become possible for 2
      clients to be using the same node number.
      So, when loading the configuration, turn off the "exclusive" flag if the
      event's node is set to "Any" (0).
      Just for completeness, fix the actual bug (introduced in main.cpp 1.744) too.
  8. 01 Sep, 2019 1 commit
    • rswindell's avatar
      Received-telnet command improvements: · 2b1bccc2
      rswindell authored
      - If a telnet command was received in multiple packets, the memcpy optimization
        in telnet_interpret() would skip/drop all bytes in the subsequent pkt payload
        before an IAC char. Don't optimize when in the middle of a telnet command.
      - If a received telnet command exceeds the telnet_cmd buffer, reset the
        received telnet_cmdlen and log a warning-level message
      - If a telnet sub-negotiation END command is received as the beginning of a
        new telnet command, log a warning-level message and reset the telnet_cmdlen.
      This fixes the occasional problem observed when using fTelnet and its sending
      the "SEND-LOCATION" sub-neg command split between 2 TCP packets. Only
      part of the first packet would be used as the location data and the rest
      processed as input from the users (e.g. as the Login: prompt). Thanks, Ree!
  9. 31 Aug, 2019 1 commit
  10. 29 Aug, 2019 1 commit
  11. 27 Aug, 2019 6 commits
  12. 26 Aug, 2019 1 commit
  13. 25 Aug, 2019 3 commits
    • rswindell's avatar
      Remove Windows 9x support, finally. · aaf03142
      rswindell authored
      Remove DEBUG.LOG file support for Win32-debug builds, never really looked-at.
    • rswindell's avatar
      A couple of passthrough socket fixes: · de72e6c3
      rswindell authored
      1. when de-activating the passthru socket, give the passthru_thread some
         cycles to copy any remaining socket data into the outbuf before we let
         the node_thread continue on and spew its own data into the outbuf.
         This fixes the problem of final messages of a file transfer protocol
         being intermixed with BBS data (prompts, menus, and such) and causing
         file download finalization issues.
      2. Don't read from the passthru socket until there is enough room in the
         outbuf for the maximum possible telnet-expanded read size. This fixes
         streaming download protocol (ZMODEM and YMODEM-G) errors.
      Also, for good measure, check the passthru_socket for writability before
      send()ing on it and log a warning if it's ever not writable.
    • rswindell's avatar
      Create/use passthru_socket_activate() function which will purge the · 59f896e6
      rswindell authored
      client_socket_dup before activating the passthru_socket. This resolves the
      issue of external programs receiving stale data from the previous passthru
      session - data that was not sucessfully read by the last external program
  14. 24 Aug, 2019 1 commit
  15. 22 Aug, 2019 1 commit
  16. 21 Aug, 2019 1 commit
    • rswindell's avatar
      Always use a passthru (proxy) socket when executing external programs that · 53884cce
      rswindell authored
      use socket I/O (e.g. sexyz, door32.sys doors, sync-xsdk doors) - not just when
      the client is connected via SSH. This solves a number of problems:
      - programs that change socket options
      - programs that don't support non-CP437 charsets (e.g. PETSCII, UTF-8)
      - programs that don't support Telnet-IAC escaping
      This greatly simplifies (reduces the need for) input_thread locking.
      The passthru_thread now handles chunks of up to 4000 bytes per transfer
      between socket and ringbuf, instead of a char at a time, greatly improving the
  17. 14 Aug, 2019 1 commit
  18. 12 Aug, 2019 2 commits
    • rswindell's avatar
      Accept and store the "Internet host number" portion of the telnet · 14f8af7d
      rswindell authored
      TERMINAL LOCATION NUMBER (RFC 946) in sbbs_t::telnet_location.
      Some (older?) versions of fTelnet request to send this option to the BBS to
      share the real IP address of the client. Accept this option (when using
      "format 0") and store the first 32-bits (an IPv4 address) in the telnet
      location storage / caller-ID information. The same place the telnet
      SEND LOCATION value is stored if received.
      Now, we're not requesting this option (e.g. with a Telnet "DO" command), but
      fTelnet doesn't need that: It offers to send it, so we accept.
    • rswindell's avatar
      delfiles() now takes a 3rd argument: keep, which is a number of files to retain · 582c898a
      rswindell authored
      (not delete) from the end of the sorted list of files (normally, 0).
      Created an sbbs_t::delfiles() wrapper which defaults to keep 0 files and also
      generates a error.log message if any of the file-deletions fail.
  19. 05 Aug, 2019 1 commit
    • rswindell's avatar
      Buld SyncTERM/VT4xx style output rate limiting into the BBS: · 23b1912a
      rswindell authored
      - new @-code BPS:x (where x is 0/unlimited, 300, 600, 1200, 2400, ... 115200)
      - new JS property: console.output_rate
      So you can have mutliple output rate changes in a single file by using multiple
      BPS @-codes.
      Hopefully this doesn't do weird things with non-compliant terminals.
  20. 04 Aug, 2019 1 commit
  21. 16 Jul, 2019 1 commit
    • rswindell's avatar
      Move login username/number parsing into a the C++ code (from login.js) since we · be7a590d
      rswindell authored
      need that internal for SSH and RLogin support of fast-logons.
      So, now, even if logging in via SSH or Rlogin, the sys_status SS_FASTLOGON
      flag will be set when the user specifies "!username-or-number" during logon and
      then the logon.js can use that to determine what to display (or not) to the
      user, during logon.
      The QWK logon support ("*username-or-number") is also handled in this new
      sbbs_t method: parse_login().
      This means the fast_logon_char is no longer configurable (hard-coded to '!')
      and the modopts.ini options are going to be parsed by logon.js from the [logon]
      section (not the [login] section).
      You still must set fast_logon=true in the [logon] section of modopts.ini to
      enable the fast-logon option for users.
  22. 09 Jul, 2019 1 commit
    • rswindell's avatar
      petdefs.h was (silently) moved from src/sbbs3 to src/encode. · eda5afb9
      rswindell authored
      Since not *everything* that #include's sbbs.h needs the PETSCII defs,
      remove it from sbbs.h and just #include petdefs.h where we need it.
      The catch-all header file is a problematic organizational design and we are
      moving away from that.
  23. 07 Jul, 2019 1 commit
  24. 20 Jun, 2019 1 commit
  25. 03 Jun, 2019 1 commit
  26. 04 May, 2019 1 commit
    • rswindell's avatar
      Define and use a wrapper for JS_GetInstancePrivate(): js_GetClassPrivate() · 6f83c4ff
      rswindell authored
      Use this in place of JS_GetPrivate() in native class methods that need the
      class instance's private data pointer and will do bad things if that pointer
      points to something other than what is expected. mcmlxxix (matt) discovered
      that using Object.apply(), you can invoke class methods where the 'this'
      instance is a different class. This would result in
      "Internal Error: No Private Data." or a crash.
      So now, gracefully detect this condition and report a meaningful error:
      "'<class-name>' instance: No Private Data or Class Mismatch"
      Also, important to note: if the method uses JS_THIS_OBJECT to get the JSObject*
      to pass to JS_Get*Private, then it must do this *before* it calls JS_SET_RVAL.
      From jsapi.h:
       * NB: there is an anti-dependency between JS_CALLEE and JS_SET_RVAL: native
       * methods that may inspect their callee must defer setting their return value
       * until after any such possible inspection. Otherwise the return value will be
       * inspected instead of the callee function object.
      The js_crypt*.c files still need this treatment.
  27. 02 May, 2019 1 commit
    • rswindell's avatar
      @-code changes: · 0868c5d9
      rswindell authored
      Expanded codes will not *not* go beyond the terminal column width (minus 1).
      If you need the old/wrap behavior, add a "-W" modifier to your @-code.
      If a length value is specified with -W, it is ignored.
      - MSG_TO, MSG_FROM, MSG_SUBJECT now reflect the header values passed
        to sbbs_t::show_msghdr(), JS bbs.show_msg_header() and not necessarily the
        actual stored (e.g. MIME-encoded) header values.
      New codes:
      - MSG_CC - reflect a message's CC list, if it has one
      - DATETIMEZONE - combines DATETIME and TIMEZONE in one string
  28. 23 Apr, 2019 1 commit
    • rswindell's avatar
      Clean up the hostname look-up stuff: · 60f996f9
      rswindell authored
      - getnameinfo() was being called with NI_NUMERICHOST in the mail server and
        web server (but nowhere else)
      - use a singly-defined macro (STR_NO_HOSTNAME) for the "<no name>" string
        rather than copying it about
      - the webserver apparently assumes that session->host_name will always have
        *some* unique value (e.g. the IP address when no hostname is available) - so
        account for that special need <grumble>
  29. 11 Apr, 2019 1 commit
    • rswindell's avatar
      Define and use sbbs_t::msghdr_tos (exposed via JS as · 0ad2c4a2
      rswindell authored
      a hack to let scripts know whether the most-recently displayed message header
      was displayed on the top of the terminal screen (or not). This allows us to
      show avatars at the top of the screen when the header is up there, rather than
      relevative to the bottom of the header (the pos can vary, depending on stuff).
  30. 09 Apr, 2019 1 commit
  31. 21 Feb, 2019 1 commit
  32. 17 Feb, 2019 1 commit