aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/ocda/io_in/carried_names.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/ocda/io_in/carried_names.d')
-rw-r--r--src/sisudoc/ocda/io_in/carried_names.d34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/sisudoc/ocda/io_in/carried_names.d b/src/sisudoc/ocda/io_in/carried_names.d
index 09e8912..84a4f3c 100644
--- a/src/sisudoc/ocda/io_in/carried_names.d
+++ b/src/sisudoc/ocda/io_in/carried_names.d
@@ -56,6 +56,40 @@
+/
module sisudoc.ocda.io_in.carried_names;
@safe:
+/+ ↓ how many members one pod archive may hold, for both writer and the reader
+ .
+ It was 500 set in the reader alone, determined when a pod held markup and
+ images. A pod that carries translation catalogues has a different
+ calculation, the count is driven by how many *files* a document is made of
+ times the number of languages it has (rather than document size). Here are
+ figures based on the document sample set:
+ .
+ entries ~= languages x (markup_files + po_files + 1)
+ + pot_files + images + 2
+ .
+ the_wealth_of_networks 213,405 words, 1 file per language
+ 12 languages -> 49 entries
+ live-manual 24,724 words, 20 files per language
+ 12 languages -> 506 entries
+ .
+ (the big book is not what runs into this; the modular manual is. At 500
+ live-manual was two languages from producing an archive spine writes and
+ then refuses to read).
+ .
+ 10,000 covers a hundred-insert manual in thirty languages, about 6,200
+ entries, with room. The number is deliberately well clear of any real
+ document rather than snug above the largest one known, because the two
+ errors are not comparable: too low refuses a legitimate document with a
+ message that reads as corruption, while too high defers to a size cap a
+ moment later.
+ .
+ This is the weakest of the three guards and is not what bounds resource
+ use. MAX_ENTRY_SIZE bounds any one member and MAX_TOTAL_SIZE bounds the
+ whole extraction, both checked before a byte is written. A count bounds
+ metadata and per-file syscalls, which at this order of magnitude is
+ nothing beside what the size caps already allow.
++/
+enum size_t MAX_POD_ENTRY_COUNT = 10_000;
/+ ↓ names that arrive from outside, and decide where a file gets written
.
A pod zip and a .ocda.db both carry files by name, and both can arrive