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>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net