Backup: Stable state with EPUB reader fixes (Freeze, OOM, Speed, State, Tooling)

This commit is contained in:
Antigravity Agent
2026-01-19 18:44:45 -05:00
parent 21277e03eb
commit 1237f01ac2
34 changed files with 1600 additions and 192 deletions

View File

@@ -39,14 +39,26 @@ static void writeString(FsFile& file, const std::string& s) {
static void readString(std::istream& is, std::string& s) {
uint32_t len;
readPod(is, len);
if (len > 4096) {
s = "";
return;
}
s.resize(len);
is.read(&s[0], len);
if (len > 0) {
is.read(&s[0], len);
}
}
static void readString(FsFile& file, std::string& s) {
uint32_t len;
readPod(file, len);
if (len > 4096) {
s = "";
return;
}
s.resize(len);
file.read(&s[0], len);
if (len > 0) {
file.read(&s[0], len);
}
}
} // namespace serialization