Skip to content
Snippets Groups Projects
  1. Nov 11, 2024
    • Rob Swindell's avatar
      Reduce LOOP_NOPEN and LOOP_USERDAT from 500 to 100 · f48e62df
      Rob Swindell authored
      With the incremental backoffs, these were super long waits for locks. Not sure
      about my math there, but at 500, the total timeout was not "about 45 seconds"
      but rather several minutes.
      
      At 100, the total max retry time should be almost exactly 45 seconds:
      
      Retries      ms-per     total seconds
        0 - 9      0          0
       10 - 19     100        1
       20 - 29     200        3
       30 - 39     300        6
       40 - 49     400        10
       50 - 59     500        15
       60 - 69     600        21
       70 - 79     700        28
       80 - 89     800        36
       90 - 99     900        45*
      100 - 109    1000       55
      110 - 119    1100       66
      120 - 129    1200       78
      130 - 139    1300       91
      140 - 149    1400       105
      150 - 159    1500       120
      160 - 169    1600       136
      170 - 179    1700       153
      180 - 189    1800       171
      190 - 200    1900       200!
      
      ... so yeah, 500 was way too big a number.
      f48e62df
  2. Nov 04, 2024
  3. Nov 02, 2024
  4. Sep 21, 2024
  5. Sep 20, 2024
  6. Sep 15, 2024
  7. Sep 12, 2024
    • Rob Swindell's avatar
      Split-up the opening and writing of msg pointer files, to help debug issue · 20cfdb18
      Rob Swindell authored
      Reported by Keyop (upon being auto-disconnected overnight):
      !ERROR 9 (Bad file descriptor) in data_ovl.cpp line 47 (putmsgptrs) writing
      "message pointers" access=0
      
      Unfortunately, the way putmsgptrs() was written, we couldn't tell if this was
      an open (data/user/*.subs file) issue or a writing issue.
      
      So create putmsgptrs_fp() and use that from sbbs_t::putmsgptrs(), so we can
      log a different error (with more accurate details) if it's a file-open failure
      versues a file-write failure.
      20cfdb18
  8. Aug 23, 2024
    • Rob Swindell's avatar
      Extend (and back-off) the user.tab record lock attempts · 69fc70ab
      Rob Swindell authored
      I'v been getting errors locking user.tab (for read) for a while (over samba),
      so hopefully this helps. The lockuserdat() total timeout duration extends from
      about 5 seconds to about 45 seconds (with an incremental back-off).
      
      Implement the same lock-retry logic/limit in putuserdat().
      69fc70ab
  9. Jun 21, 2024
    • Rob Swindell's avatar
      Fix getnodedat() error handling and usage · e7642321
      Rob Swindell authored
      If a file descriptor is passed to getnodedat() and the lock retry counter was
      reached, the file would be closed, but the passed file descriptor reference
      would not be set to -1. This could result in exceptions (from subsequent read
      attempts on the referenced file descriptor) in cases where the node.dab could
      not be locked or read by getnodedat() and was thus closed.
      
      The set/get_node_* helper functions (used by MQTT) were not initializing the
      node.dab file descriptor (i.e. to -1), so it's possible getnodedat() could
      try to read from and close an invalid/wrong open file descriptor. If the local
      variable happened to be initialized to a value <= 0, then, no problem, but
      this is undefined behavior (UB).
      e7642321
  10. May 04, 2024
    • Rob Swindell's avatar
      Change client_t.protocol from pointer to buffer · dd2afc92
      Rob Swindell authored
      Fix observed crash when shutting down services server where the client_t
      protocol was pointing to a freed service's protocol description string.
      
      This was the last pointer in client_t and should resolve the last race
      conditions (memory ownership issues) with its data members.
      
      This also resolves a small memory leak in getnodeclient() where the last
      client "gotten" would have its heap-duplicated protocol string leaked.
      dd2afc92
  11. Apr 28, 2024
  12. Mar 19, 2024
  13. Mar 03, 2024
    • Rob Swindell's avatar
      Address the SFTP logon issues (timeout waiting for keypress, node status, etc) · f1276068
      Rob Swindell authored
      For SFTP sessions, there's no shell/terminal, so no need to run command
      shells (with their input timeouts, etc.). Reflect the node connection as
      "via sftp" in the node status. Handle node interruption signal. Probably more
      to do here with node status/actions (e.g. it'd be nice to set the action to
      "uploading or "downloading" when appropriate).
      f1276068
  14. Feb 14, 2024
  15. Feb 11, 2024
  16. Jan 20, 2024
    • Rob Swindell's avatar
      The great BOOL->bool conversion in xpdev · 118984e9
      Rob Swindell authored
      Still using BOOL where we need Win32 API compatibility.
      Using JSBool instead of BOOL or bool where it matters.
      Changed most relevant TRUE/FALSE to true/false too (though it's not as critical).
      
      You shouldn't need to #include <stdbool.h> anywhere now - gen_defs.h should do that automatically/correctly based on the language/version/tool. In C23, stdbool.h isn't even needed for bool/true/false definitions (they're keywords), so we don't bother including stdbool.h in that case.
      Microsoft didn't define __STDC_VERSION__ in their older tool chains (even though they were C99 compatible and had stdbool.h), so we use a _MSC_VER check to know that there's a stdbool.h we should use in that case.
      
      For other/old compilers (e.g. Borland C) we #define bool/true/false following the pattern of stdbool.h (doesn't use a typedef).
      
      I didn't convert UIFC yet.
      
      This addresses issue #698
      118984e9
  17. Jan 02, 2024
  18. Dec 31, 2023
    • Rob Swindell's avatar
      Allow sysop-configurable date separator (e.g. YYYY-MM-DD) · 013bcca9
      Rob Swindell authored
      To complete the request from: Max (WESTLINE)
      
        Is it possible to do a new dateformat in scfg
        In sweden we using YYYY-MM-DD format as standard.
      
      The default will be '/'.  Technically, any separator is possible by editing
      the "date_sep" value in the global section of main.ini.  SCFG allows the
      most popular separators: /.- and space.
      013bcca9
    • Rob Swindell's avatar
      Introduce 3rd system/local date display format: YY/MM/DD · 96976ab5
      Rob Swindell authored
      ... and YYYY/MM/DD for birthdate input/display.
      
      Now set in SCFG->System (not toggle options) and stored in the "date_fmt" key
      (new) in main.ini. The old sys_misc SM_EURODATE flag is deprecated (but used
      to determine the default value of date_fmt when not present).
      
      As requested from: Max (WESTLINE)
      
        Is it possible to do a new dateformat in scfg
        In sweden we using YYYY-MM-DD format as standard.
      96976ab5
  19. Dec 29, 2023
  20. Dec 18, 2023
  21. Dec 17, 2023
    • Rob Swindell's avatar
      Add support for metadata in *.can (filter) files · 2af212db
      Rob Swindell authored
      I wanted a couple of features for filters (e.g. blocked IP addreses):
      - expiration date, optionally (only block for a limited time)
      - display details of reason for filter in log messages (at time of block)
      
      I've been thinking for some time that these files should be converted to .ini,
      but then it occurred to me that I could do a sort of hybrid where the metadata
      was key/value pairs tab-delimited from the search-pattern (first text on the
      line). This is backward comaptible, relatively easy to view/edit by hand, and
      extensible (easy to add/remove metadata fields in the future). So they'll
      remain as text/*.can files.
      
      The maximum line length for findstr/trashcan parsed files extended from 255 to
      1000 characters.
      
      Moved all trashcan-related functions from scfglib1.c to (new file) trash.c.
      
      For the first time, I actually tested a build on WSL *before* committing to
      Git. So, this *should* pass CI the first time. :-O
      2af212db
    • Rob Swindell's avatar
      Fix typos in comments · 240682c0
      Rob Swindell authored
      240682c0
    • Rob Swindell's avatar
  22. Dec 16, 2023
    • Rob Swindell's avatar
      New findstr functions that can search for (up to) two strings in one go · dd37a468
      Rob Swindell authored
      Many searches are done (e.g. in the mail server, QWK import) for either of 2
      strings in single file or list, so let's optimize that to a single iteration
      through the file/list. This should reduce some redundant file I/O.
      
      I do find this API a little confusing with the filename or list at the end
      of the argument list, but kept it consistent with the existing single string
      findstr functions (which are now just wrappers for the new 2-string flavors).
      
      I noticed during this update that findstr() did not share the same behavior
      as findstr_in_list() (feature added in commit f08f2137) whereby if all the
      patterns were negative searches (beginning with '!'), then *all* the
      negative matches would have to be successful (not just the first) for the
      function to return true. So now findstr() behaves like findstr_in_list()
      in this regard.
      
      I also added some optimizations to findstr_in_string().
      dd37a468
  23. Dec 15, 2023
  24. Dec 03, 2023
  25. Oct 26, 2023
    • Rob Swindell's avatar
      Initial support or multiple (user-selectable) languages in the terminal server · 35042374
      Rob Swindell authored
      Uses the new ctrl/text.??.ini files (just a few words translated so far).
      Adds the new "lang" user property (to user.tab and JS User class).
      The language code is the 2-3 char (e.g. ISO 639-1) abbreviation of a language.
      A "blank" language property value (the default), just means to use the
      ctrl/text.dat contents.
      User-selected alternate language file is loaded upon logon and in the
      built-in/hard-coded user default settings menu.
      More on the user default settings menu:
      - AutoLogin via IP option ('I') to make room for new (I) Language option.
      - The cold-keys menu option was removed to make room for Language option
        (via text.dat change to UserDefaultsHotKey)
      - Any options disabled via blank text.dat strings will no longer result in
        supported command keys (that could accidentally be struck with hidden
        consequences/effect)
      - The user_settings.js will need similar treatment
      
      text/menu/<lang>/* is where alternate language menu files should be stored
      
      New UserDefaultsLanguage text.dat string (inserted before new PasswordChar
      string).
      35042374
  26. Sep 12, 2023
    • Rob Swindell's avatar
      Allow JS 'user.editor' and '.shell' to be set for non-users (e.g. user #0) · c0370d3c
      Rob Swindell authored
      The request from Nightfox and Accession via DOVE-Net was to be able to set
      a user's external editor even if there's no user logged-in.
      
      These 2 user class properties in the JS object model were a bit special in
      that they *only* wrote to the user database and did not immediately modify
      the in-memory copy of the user_t structure, depending on the re-reading of
      the user.dat/tab file to re-populate the current user_t structure when needed.
      This didn't work if the current user is user #0 (no user).
      
      So, set the current user_t.xedit and user_t.shell accordingly whenever those
      JS properties are assigned a value (a string, the appropriate internal code).
      c0370d3c
  27. Aug 10, 2023
  28. Jun 09, 2023
    • Rob Swindell's avatar
      <Deuce> ... billion-and-one result of comparison of constant 100000 warnings. · 2b087b8b
      Rob Swindell authored
      So Clang-FreeBSD was warning (in compiles of scfg/scfg*.c by Deuce):
      result of comparison of constant 100000 with expression of type 'uint16_t'
      (aka 'unsigned short') is always true
      
      Why? Cause a uint16_t's max value is 65535 (less than 100000). Sure we could
      have just lowered the UIFC max number of config items to 65535, but that would
      have been too easy. And why are these compared-with values of type uint16_t to
      begin with? Because most ctrl/*.cnf lists (of configuration items) were
      limited to 65535 entries cause ... 16-bit DOS, historically. Now that *.cnf
      files aren't used, we could just increase these scfg_t.*_total type sizes from
      16 to 32-bits, yeah? The result is this commit.
      
      I went to (signed) int so we could still keep -1 as the special illegal
      sub/dir num value (e.g. INVALID_SUB, which is sometimes used to indicate the
      email message base). Theoretically, 2 billion configuration items could be
      supported in these lists, but SCFG will limit you to 100000 anyway. So there's
      a whole lot of s/uint/int in this commit.
      
      I'd be very surprised if this doesn't result in some new GCC/Clang warnings,
      but at least the old "comparison of constant 100000" warnings are now gone!
      2b087b8b
  29. Jun 05, 2023
  30. May 09, 2023
    • Rob Swindell's avatar
      The "user" directory is special: you don't need "access" to download from it. · b51af8fe
      Rob Swindell authored
      When sending a user-to-user file transfer, SBBS (since v3.19) will check that
      the file recipient will be able to download it (e.g. doesn't have restrictions
      preventing it) and this was failing for most (non-sysop) recipient users since
      they wouldn't normally meet the "access restrictions" of the user directory
      (by design).
      b51af8fe
  31. Apr 03, 2023
  32. Apr 02, 2023
    • Rob Swindell's avatar
      Move the special FTN/QWKnet address formatting to a userdat-exported function · e59fbe68
      Rob Swindell authored
      smtp_netmail_addr() - not currently used anywhere else, but may be someday.
      load/mailutil.js's fidoaddr_to_emailaddr() has this same logic (for FTN addrs
      at least and is now used by nntpservice.js).
      
      Also, always pass a buffer to smb_faddrtoa() from the mail server since it's
      multi-threaded and its unsafe to pass NULL (using a static local buffer).
      e59fbe68
  33. Mar 11, 2023
    • Rob Swindell's avatar
      More strict login-by-user-number support (parsing logic) · fbd22cb8
      Rob Swindell authored
      Before now, if the sysop enabled login-by-user-number and the specified login
      ID *started* with a decimal digit, it'd be treated as a user number and
      converted to a 32-bit integer. This could result in weird stuff, like this
      error I got today:
      SMTP ... !ERROR -2 getting data on user (7000401005.gc7gg@synchro.net)
      
      7,000,401,005 is clearly greater than the number of users in my user base
      on Vert, but since 7B is > 2.1B (0x7fffffff), the number would be parsed as
      a *negative* integer value and thus less than the total number of users in my
      userbase.
      
      An obvious solution would be to just turn of login-by-user-number, and for
      most systems, I suggest doing that (a system is less secure with it enabled).
      
      However, I want to leave the option for sysops (at least for now) and don't
      want this weird behavior so, a login by user number now requires that the
      entire login ID is just decimal numbers, nothing else, and the number is
      parsed as an unsigned integer. So yes, roll-over can happen for very high
      numbers (>4.2B), but in no instance will the number be parsed as negative and
      thus lead to an invalid user record look-up attempt.
      fbd22cb8
  34. Mar 05, 2023
    • Rob Swindell's avatar
      Add user_t.mail (in JS, user.mail_settings) to remember mail preferences · cf0d5714
      Rob Swindell authored
      Right now, the only preference is reverse mail listings (oldest first
      or newest first). These settings are only used when reading "your mail",
      not any other kind of mail reading.
      
      bbs.read_mail() now returns the user-adjusted loadmail_mode value and
      this allows us to determine the user's preferences and save them after
      this function/method is called. A readmail_mod can now return a number
      (other than 0) and that will be used as the return value of this method.
      
      sbbs_t::readmail() now does the adjustment of the passed lm_mode before
      calling any installed readmail_mod, so if for example, deleted message
      viewing is enabled by the sysop, those LM_* flags might be set now in
      the argument to the readmail_mod, wherase they never would before.
      
      There is not yet any way for the sysop to set a new user's default
      mail_settings, they'll just default to 0 for now.
      
      email_sec.js will get some adjustments to use/store the
      user.mail_settings next.
      cf0d5714
Loading