fix(relay): the authority list follows its file's content, not its file time
A file time is only as fine as the operating system's clock tick (about 15 ms on Windows), so a second edit within one tick kept the same time and reload() saw no change: an operator's quick second edit was ignored. The list now remembers the text it last read (good or bad) and reloads when the text differs; the file is capped at 64 KiB and read at each 30 s housekeeping tick. A bad file is still refused and never replaces a good list. The tests no longer force the change, and the dns test says what happened if it fails. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
dfd1c2c914
commit
227b692202
2 files changed
+72
-16
No files matched your search
@@ -768,7 +768,10 @@ mod tests {
|
||||
"{one}[[authority]]\nid='b'\ndirectory='https://y/d'\ncaa_domain='ca-two.example'\n"
|
||||
);
|
||||
std::fs::write(&path, two).unwrap();
|
||||
assert!(list.reload().unwrap());
|
||||
assert!(
|
||||
list.reload().unwrap(),
|
||||
"the list file was rewritten and the reload saw no change"
|
||||
);
|
||||
assert_eq!(caa(&svc).len(), 2);
|
||||
// No authority listed: no CAA record, which restricts nobody.
|
||||
let none = DnsService::new(
|
||||
|
||||
Reference in new issue
Block a user