https://gitlab.synchro.net/main/sbbs/-/commit/6de0bf87c59a00c09f226ad2
Modified Files:
docs/v322_new.md src/sbbs3/filterfile.hpp
Log Message:
filterFile: keep the loaded list when a changed filter file can't be read
filterFile (ip.can, ip-silent.can, host.can, ipfilter_exempt.cfg, spamblock.cfg, dnsbl_exempt.cfg, ...) freed its cached list before
reading the changed file, and recorded the new date whether or not the
read succeeded. A file that could not be opened, even after fnopen()'s
retries, was therefore treated as empty until its date changed again:
for ipfilter_exempt.cfg, a file rarely edited, every exemption could
vanish until the next edit.
Now:
- An unreadable file keeps the list already loaded until the file
changes again. It is not retried at each check: each attempt repeats
fnopen()'s lock retries (about 28 seconds for a permission error) with
the mutex held, stalling every thread that consults the filter.
- A deleted file lists nothing. It used to keep its last contents,
because fdate()'s -1 was not newer than the recorded date.
- Any change of date reloads the file, so one restored from a backup
with an older date is read.
- A file changed within the last second is read again at the next
check, in case it was read while still being written.
Tested on Linux with the web server and ip.can: an entry blocks; the
file deleted, the entry no longer blocks; restored with a date two days
older, it blocks again; rewritten without the entry but unreadable, the
entry still blocks (the first check waited out fnopen()'s retries, 28
seconds, the next did not); readable and changed, it no longer blocks.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)