• exec/tests/qwkjob/hub.js

    From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Mon Oct 26 00:09:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/40335755ba68e406a162d05c
    Modified Files:
    exec/tests/qwkjob/hub.js unpack.js src/sbbs3/ftpsrvr.cpp main.cpp qwkjob.cpp web/root/qwk.ssjs
    Log Message:
    qwkjob: import only regular files; keep fresh empty packets

    A packet path handed to qwkjob_unpack_rep() or qwkjob_unpack_qwk() is now required to name one existing regular file and to contain no wildcard characters, checked before any lock, temp directory or file move. Before,
    a directory was refused only because fexist() is false for one (logged as "already gone"); a FIFO blocked the job on open, holding the user or hub
    lock with it; a device such as /dev/null reports 0 bytes and was removed
    as an empty packet; and a "*" or "?" in the path matched other files in fexist(). Such a path is now logged as "not a regular file" at LOG_ERR,
    returns QWKJOB_FAILED and is left alone. A missing file is still the debug-level "already gone" case: another host's sweep imported it.

    An empty packet is removed only when it sits in the sweep directory
    (data/file/ for a REP, data/ for a hub packet) and has not been modified
    for more than a minute; otherwise the import fails and the file is left
    where it is. An empty file there may be one that an FTP upload or an
    external fetcher has just created and is still writing, and removing it
    would unlink the file under the writer and silently lose the packet; the
    event thread used to skip empty packets altogether. The hub sweep now
    passes a young empty packet over with only a debug line each pass.

    FTP and the Web server's qwk.ssjs receive a REP into temp/rep/, outside
    the sweep directory, so they now remove their own file after a failed
    import; before, FTP would have queued an empty upload for the sweep.

    The event thread no longer adds its own debug line for a busy hub; qwkjob_lock_hub() already logs it.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Mon Oct 26 00:09:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/55572f85609652cd72413fe2
    Modified Files:
    exec/tests/qwkjob/hub.js unpack.js src/sbbs3/qwkjob.cpp
    Log Message:
    qwkjob: judge a packet empty only under its locks

    qwkjob_unpack_qwk() and qwkjob_unpack_rep() checked for (and removed) an
    empty packet over a minute old before taking the hub lock, or the user and <rep>.lock locks. A QWKnet call-out such as qnet-http.js receive_qwk()
    opens data/<HUBID>.qwk for writing and downloads into it while the event
    thread holds that hub's lock across the call-out, so another host's sweep
    could remove the file mid-download, as soon as the download had stalled
    for a minute.

    The check now runs after the locks are taken, so a busy lock leaves the
    file alone; the regular-file and wildcard check still comes first.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>