Skip to content
Snippets Groups Projects
  1. Jan 14, 2025
  2. Jan 11, 2025
  3. Jan 10, 2025
    • Rob Swindell's avatar
      Add "native" toggle option to Viewable/Extractable/Testable/Compressible files · 65cbf055
      Rob Swindell authored
      ... and download events.
      
      The "Native Program List" was a hack left over from the transition from
      MS-DOS to OS/2 and now with extensible configuration files, like we have now,
      there's no reason not to add more fields and make it easier to specify which
      of these programs (most/all of them nowadays) are actually native to the
      host OS.
      
      The defaults (e.g. when creating a new file type) are unchanged for now.
      65cbf055
  4. Dec 01, 2024
    • Rob Swindell's avatar
      Simplify the getnode.cpp API - use bool returns, default paramaeter value · 62ed3d3a
      Rob Swindell authored
      getnodedat() now performs a non-locked read by default.
      
      Perform more checks of getnodedat() return value before calling putnodedat()
      to avoid unintentionally zeroing out node.dab records.
      
      Add/use unlocknodedat() method for unlocking a node.dab record without
      writing.
      
      Note: The userdat.c getnodedat() and putnodedat() still return int (i.e. 0 on
      success), so that can be confusing.
      62ed3d3a
  5. Oct 28, 2024
  6. Oct 16, 2024
  7. Oct 12, 2024
    • Rob Swindell's avatar
      File/batch upload decomp for scripting, unique-password-check fix, Ctrl-AX fix · 095368c0
      Rob Swindell authored
      Created sbbs_t::batch_upload() and JS bbs.batch_upload()
      returns true if one or more blind-uploads were received and all files in
      the batch upload queue (if any) were received
      
      The Rainbow Ctrl-A codes (x|X) are not valid for message (there's no universal
      ANSI equivalent) - so treat as "invalid Ctrl-A codes" for most (message) uses.
      e.g. they're stripped when entered into text with the internal message editor.
      
      sbbs_t::chkpass() and JS bbs.good_password() now default to *not* requiring
      the password to be substantially different from the user's current password.
      This fixes weird issues where a user that just wanted to add more characters
      to their current password woudl not be allowed by cause the new password was
      "too obvious"
      JS bbs.good_password() now accepts an optional second argumnet: forced_unique
      which defaults to false.
      sbbs_t::chkpass() (JS bbs.good_password()) would always return false if the
      provided password was the same as the user's current password, regardless of
      the 'unique' parameter value. Now, only reject unchanged password when unique
      is true.
      
      sbbs_t::upload() and JS bbs.upload_file() now accept an optional second
      argument: 'filename' which when specified, the function won't prmopt for the
      user-supplied filename.
      
      New JS property: file_area.max_filename_length
      
      file_area.min_diskspace, settings, and web_vpath_prefix are now read-only.
      These properties should not have been writable.
      095368c0
    • Rob Swindell's avatar
      Rename sbbs_t::batch_upload() to process_batch_upload_queue() · fcf7ace4
      Rob Swindell authored
      That was a badly named function.
      fcf7ace4
  8. Aug 08, 2024
    • Rob Swindell's avatar
      Don't display menu of file xfer prots when auto-selecting user's default prot · 64a6ab9d
      Rob Swindell authored
      When a user has a "default download protocol" selected (configured for their
      user account), don't display a menu of file transfer protocols when we're
      just going to auto-select their default anyway (e.g. when downloading a QWK
      packet).
      
      This change also introduces an argument (%s, the protocol name) in the
      StartXferNow text.dat string, so that if/when the user forgets which default
      download transfer protocol they had selected, they'll be reminded ("oh yeah,
      I need start an XMODEM download!").
      
      This fixes issue #767
      64a6ab9d
  9. Apr 28, 2024
  10. Mar 05, 2024
  11. 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
  12. 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
  13. Mar 11, 2023
  14. Mar 04, 2023
  15. Mar 03, 2023
    • Rob Swindell's avatar
      Better access enforcement to files in batch download queues · f2adb547
      Rob Swindell authored
      If a file gets added to a batch download queue that a user doesn't have download-access to (at the time of batch download), deal with that gracefully and consistently.
      
      start_batch_download():
      - Now checks current user access to download the file in both single-file and batch modes
      - Now performs credit-check in single-file mode (wasn't doing so previously)
      - totalsize of multi-file batch download queue is now calculated again (apparently removed/broken in the new filebase conversion of v3.19), so download ETA should be calculated more accurately (?) again
      - Use gettimetodl() to calculate each file's download time for multi-file downloads
      - Using new putnode_download() method to write node downloading "action" and ETA-in-aux fields
      - The node status wasn't being updated at all before start of download in single-file mode - fixed
      
      create_batchdn_lst() :
      - Checks each file still downloadable by the user and if not, removes from the queue (and the generated list file).
      - Performs credit check and removes files that exceed available user credit
      - returns true only when 1 or more files is added to the batch download list file
      
      addtobatdl()
      - Removed redundant 'D' restriction check - this is handled by can_user_download() check already.
      - Use the 'reason' out parameter from can_user_download() to determine which error string to display (not always CantDownloadFromDir).
      f2adb547
  16. Feb 26, 2023
  17. Feb 12, 2023
  18. Dec 30, 2022
  19. Nov 17, 2022
  20. Nov 12, 2022
    • Rob Swindell's avatar
      Change iniOpenFile() argument meaning from "create" and "for_modify" · f4d2e708
      Rob Swindell authored
      Now, if the BOOL argument value is FALSE, then the .ini file is opened read-only (and thus only read permissions are needed, resolving issue #455).
      
      If the BOOL argument value is TRUE, create-if-not-exist is implied. There are no use cases where we would want to open an .ini file for writing only if it already existed.
      f4d2e708
  21. Apr 28, 2022
  22. Mar 24, 2022
    • Rob Swindell's avatar
      Support user credits and transfer stats > 4GB in total · 2d4ec7b8
      Rob Swindell authored
      Credits and daily free credits are accurate to the byte up to (a maximum) of 18446744073709551615 (that's 18 Exbibytes - 1).
      
      User's upload and download byte stats are now similarly extended in maximum range, but the accuracy is only "to the byte" for values less than 10,000,000,000. Beyond that value, the accuracy declines, but is generally pretty damn accurate (to 4 decimal places beyond the nearest multiple of a power of 1024), so I don't expect that to be an issue. This method of storing upload/download byte stats allowed me to use the same 10-character user record fields in the user.dat file.
      
      As a side-effect of this enhancements:
      * User and file credit values are now expressed in multiples of powers of 1024 (e.g. 4.0G rather than 4,294,967,296).
      * Free credits per day per security level has now been extended from 32 to 64-bits (to accommodate values >= 4GB).
      * adjustuserrec() now longer takes the record length since we can easily determine that automatically and don't need more "sources of truth" that can be out-of-sync (e.g. the U_CDT field length going from 10 to 20 chars with this change).
      * setting the stage for locale-dependent thousands-separators (e.g. space instead of comma) - currently still hard-coded to comma
      * more/better support for files > 4GB in size (e.g. in the batch download queue)
      * user_t ulong fields changed to either uint32_t or uint64_t - I didn't realize how many long/ulong's remained in the code (which are sometmies 32-bit, sometimes 64-bit) - ugh
      * Steve's ultoac() function renamed to u32toac() and created a C++ wrapper that still uses the old name, for homage
      2d4ec7b8
  23. Mar 21, 2022
    • Rob Swindell's avatar
      SMB items (messages or files) can now have 32-bit or 64-bit cost value · f1332d3e
      Rob Swindell authored
      To fully support files > 4GB in size in file bases, credit values larger than 32-bits must be supported too.
      
      There's a couple of todo comments/items included in this commit, but that's mainly to do with messages (which don't really have costs anyway).
      
      The main thing to deal with now is the fact that users can't have more than 4GB in credits in the first place! That's got to be fixed next.
      f1332d3e
  24. Feb 24, 2022
  25. Feb 01, 2022
  26. Jan 27, 2022
    • Rob Swindell's avatar
      Allow files to be removed from batch queues by number · 2dfde4da
      Rob Swindell authored
      This fixes issue #328.
      
      The user actually *can* remove files from the batch queues in v3.19b, but you have to type the filenames which is not obvious from the prompt which implies you need to type the file index position (e.g. '1' for the first file in the queue). In all Synchronet versions prior, you could only remove by number (and not by name).
      
      The fix is to allow either the number or the name of the file to be entered at the RemoveWhich prompt and the file is removed from the queue successfully.
      
      Thanks Ragnarok!
      2dfde4da
  27. Jan 20, 2022
    • Rob Swindell's avatar
      Use the progress() interval argument as the time interval · db05ca40
      Rob Swindell authored
      Default the progress time interval to 500 milliseconds (twice a second).
      
      Don't specify a count/call interval in the call-sites, since we really want to use time-based progress updates now only and the default probably will work fine everywhere.
      db05ca40
  28. Nov 18, 2021
    • Rob Swindell's avatar
      Add text.dat lines for "All" and the List key ('L'), used in quoting · 9513bdba
      Rob Swindell authored
      The internal line editor's quoting feature add some hard-coded strings ("Done" and "All") and the (L)ist key was hard-coded. Use the text.dat string (new and pre-existing) for these now.
      
      Also, use the new sbbs_t *_key() methods for referencing the configured key bindings (via text.dat) for these common key-stroke commands.
      Convert the text.dat strings for keys (e.g. YNQP) to uppercase always as well.
      9513bdba
  29. Oct 23, 2021
    • Rob Swindell's avatar
      Fix segfault after batch-upload when no "uploads" dir specified · 1f93fd53
      Rob Swindell authored
      When there's no "uploads" directory configured by the sysop, cfg.upload_dir will be set to INVALID_DIR, which cannot be used as an index into cfg.dir[] to determine if the time used for uploading the files should be "given back" to the user.
      
      In v3.18, we used the first file in the upload queue, if there was one, else fell back to the "uploads" dir (which had to have been defined if there were no files in the queue). So this illegal array indexing was a regression in v3.19.
      
      Reported by Zoltán Gábor on Facebook
      1f93fd53
  30. Jun 10, 2021
  31. Jun 06, 2021
  32. Apr 04, 2021
    • Rob Swindell's avatar
      A poll() failure with EINTR does not mean a socket is closed. · 925e3b0a
      Rob Swindell authored
      This won't impact Synchronet as it has a separate signal handling
      thread, but we still need to behave properly for processes that
      don't.  I'm also saying that ENOMEM does not indicate a disconnection,
      though it may be better to pretend it was disconnected...
      925e3b0a
  33. Aug 16, 2020
Loading