MCPcopy Create free account
hub / github.com/Niko1221/Strata / source

Method source

engine/src/core/conversation_file.cpp:652–671  ·  view source on GitHub ↗

a K/V part pulled from its owner straight into the file block (sizing pass: counted, never read)

Source from the content-addressed store, hash-verified

650 }
651 // a K/V part pulled from its owner straight into the file block (sizing pass: counted, never read)
652 void source(const SessionKvSource& s, size_t part) {
653 const size_t size = s.sizes[part];
654 u64(size);
655 if (!f) { count(size); return; }
656 for (size_t at = 0; at < size && ok;) {
657 size_t room = 0;
658 uint8_t* d = f->span(room);
659 const size_t c = std::min(room, size - at);
660 if (!s.read || !s.read(part, at, d, c)) {
661 ok = false;
662 read_failed = true;
663 if (s.error) read_error = s.error();
664 return;
665 }
666 if (hash) hash->update(d, c);
667 count(c);
668 ok = ok && f->commit(c);
669 at += c;
670 }
671 }
672 bool read_failed = false;
673 std::string read_error;
674};

Callers 1

put_payloadFunction · 0.45

Calls 8

u64Function · 0.50
countFunction · 0.50
minFunction · 0.50
spanMethod · 0.45
readMethod · 0.45
errorMethod · 0.45
updateMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected