https://gitlab.synchro.net/main/sbbs/-/commit/043587351c9f3c6f0078c857
Added Files:
exec/load/filecontents_lib.js exec/tests/filecontents_test.js
Modified Files:
exec/archive.js
Log Message:
Store archive content listings per file area in data/dirs/<code>.contents
Viewers re-opened and enumerated an archive on every view. On a public file base under crawler load that is nearly all wasted work: across six days, 72%
of ?view= requests were the first ever for that URL, so an expiring cache
would sit near a 28% hit rate. It is also repeated exposure to the mozjs185 out-of-memory failure that d777bda5c5 (2026-06-01) only deflects crawlers
away from.
filecontents_lib.js keeps the extraction outcome in a per-area JSON file
beside the base it derives from, keyed by filename and validated against the file's size and mtime. Records carry a format version and an extractor-set version. The second guards the verdict rather than the encoding, so a stored failure is re-examined when the extractor set changes while a stored listing
is not. Whole-base projection is about 82 MB, so listings are stored uncapped.
Failures are stored too. 171 of 600 sampled archive-extension files are .arc, which libarchive cannot read at all, so each one re-attempted a doomed extraction on every view. Those now fall back to lsar, which read 80 of 80 sampled .arc files, and are enumerated once.
The external tool runs via system.exec() with its output redirected to a file rather than system.popen(), whose _popen() needs a console and so fails inside a Windows service. ILLEGAL_FILENAME_CHARS already excludes " and \, but $ and
a backtick are legal in a file-base filename and are still expanded by sh inside double quotes, so a path containing either is never handed to a shell.
archive.js is given a path and cannot know which area holds it, and cmdstr() has no specifier that could pass one, so the library maps the path back to an area itself. A file outside every area is enumerated but not stored, there being nowhere to persist it. Verbose listings still read the archive, since
CRC and compression format are not stored.
#1247
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)