https://gitlab.synchro.net/main/sbbs/-/commit/7f7405edb9401958cafe52f6
Modified Files:
src/sbbs3/bat_xfer.cpp filedat.c filedat.h upload.cpp src/smblib/smblib.vcxproj
Log Message:
Blind uploads: answer the name search from the batch cache too (#1132)
The blind-upload path refuses a file whose name already exists in any dupe-checked directory, and that search still opened and read every
directory's index once per file, the same cost the hash scan had before
the batch cache. Cache a hash of each index name (FNV-1a over the name
folded to lower case, since the question is whether the name exists in
any case) alongside the size and hash values, and answer the name search
from it: a hash hit is confirmed by reading that one index, so a false
positive costs an index read rather than a wrong "already online" verdict.
dupe_cache_findfile() and dupe_cache_findname() now fall back to
findfile() themselves when given no cache, so the callers no longer
branch on whether one exists.
Verified on the scratch install across three batch uploads under strace:
every other directory's index was opened once per batch by the name pass
and reused by the hash scan, where it had been opened once per file, and
a file re-sent under an existing name was refused by the name pass.
fnv1a.c is added to the MSVC smblib project, where the other hash sources
are compiled; that side is not verified here.
Co-Authored-By: Claude Fable 5.1 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net