• src/sbbs3/js_filebase.c

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sunday, March 20, 2022 20:32:05
    https://gitlab.synchro.net/main/sbbs/-/commit/623c49e43906d3f86fb3c247
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    File's meta-object's "size" and "time" properties reflect current values

    Query the disk for file's current "size" and "time" values when get_list() or get() method is used with a "detail" level of >= DETAIL.NORMAL and the "check file existence" toggle option is enabled for this directory in SCFG.

    I pondered and contemplated whether this configuration setting should be checked/applied here or in the various JS scripts (e.g. filelist.js) and decided here was best to provide the most uniform/expected behavior, even though there is a performance impact. If a script doesn't need/use these properties, they should probably be specifying the DETAIL.MIN (minimal) detail level in their queries anyway, which will then bypass these performance-impacting disk queries.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sunday, December 24, 2023 17:33:28
    https://gitlab.synchro.net/main/sbbs/-/commit/41ace72c24800de0fa0b3b23
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix filebase corruption caused by FileBase.renew()

    echicken reported this problem: pretty severe filebase corruption as a result of calling FileBase.renew(). The problem seemed pretty obvious (only loading the file's index record), but I do think the underlying SMBLIB functions
    should be more resilient to misuse and not corrupt the base. So, that's still
    a TODO.

    No existing scripts were using FileBase.renew(), so this problem has gone unnoticed since SBBS v3.19.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Monday, December 25, 2023 20:29:47
    https://gitlab.synchro.net/main/sbbs/-/commit/22d7343f21cbd9cee29a4118
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Rename the METADATA and metadata properties to AUXDATA and auxdata

    To eliminate confusion with the file-meta-object that this API deals with
    more than anything else.

    echicken's suggestion

    Nothing used this property before now, so this should be fine.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thursday, December 28, 2023 18:10:58
    https://gitlab.synchro.net/main/sbbs/-/commit/ad309d463528da40cfd32354
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix misuse of JSVAL_TO_DOUBLE() for "cost" and "size" file-meta-obj properties

    As pointed out by echicken: when setting the "cost" property to any value, the actual
    file's cost would be set to 9223372036854776000 regardless of what number was in the
    provided file metadata object. Most jsval numbers aren't doubles (they're ints) so
    need to use JS_ValueToNumber() to do the proper conversion, regardless of underlying
    type.

    Noticed the same problem with the "size" property.

    Thanks for the tests and report echicken!

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Friday, December 29, 2023 17:10:27
    https://gitlab.synchro.net/main/sbbs/-/commit/0dbd3f064a2dee66cca6c409
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    Fix some apparent memory leaks when using file's auxdata

    Nobody's really using this auxdata yet, besides echicken, so no impact for others.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Friday, December 29, 2023 17:10:27
    https://gitlab.synchro.net/main/sbbs/-/commit/831ddd710d935eee37639446
    Modified Files:
    src/sbbs3/js_filebase.c
    Log Message:
    When FileBase.update() is called with readd_always=true, update date-added

    The use from addfiles.js (the -readd option) implies this is what's expected. And echicken was suprised the 'added' date/time-stamp wasn't udpated.

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