| 3521 | } |
| 3522 | |
| 3523 | inline 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 | |
| 3542 | template <typename T> |
| 3543 | inline bool read_content_chunked(Stream &strm, T &x, |
no test coverage detected