MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / read_content_without_length

Function read_content_without_length

examples/server/httplib.h:3523–3540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3521}
3522
3523inline bool read_content_without_length(Stream &strm,
3524 ContentReceiverWithProgress out) {
3525 char buf[CPPHTTPLIB_RECV_BUFSIZ];
3526 uint64_t r = 0;
3527 for (;;) {
3528 auto n = strm.read(buf, CPPHTTPLIB_RECV_BUFSIZ);
3529 if (n < 0) {
3530 return false;
3531 } else if (n == 0) {
3532 return true;
3533 }
3534
3535 if (!out(buf, static_cast<size_t>(n), r, 0)) { return false; }
3536 r += static_cast<uint64_t>(n);
3537 }
3538
3539 return true;
3540}
3541
3542template <typename T>
3543inline bool read_content_chunked(Stream &strm, T &x,

Callers 1

read_contentFunction · 0.85

Calls 2

outFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected