| 3323 | } |
| 3324 | |
| 3325 | inline bool read_content_without_length(Stream &strm, |
| 3326 | ContentReceiverWithProgress out) { |
| 3327 | char buf[CPPHTTPLIB_RECV_BUFSIZ]; |
| 3328 | uint64_t r = 0; |
| 3329 | for (;;) { |
| 3330 | auto n = strm.read(buf, CPPHTTPLIB_RECV_BUFSIZ); |
| 3331 | if (n < 0) { |
| 3332 | return false; |
| 3333 | } else if (n == 0) { |
| 3334 | return true; |
| 3335 | } |
| 3336 | |
| 3337 | if (!out(buf, static_cast<size_t>(n), r, 0)) { return false; } |
| 3338 | r += static_cast<uint64_t>(n); |
| 3339 | } |
| 3340 | |
| 3341 | return true; |
| 3342 | } |
| 3343 | |
| 3344 | inline bool read_content_chunked(Stream &strm, |
| 3345 | ContentReceiverWithProgress out) { |