mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-09-30 20:52:31 +07:00
make_file_body() measures the file once and that length is already the response's Content-Length. The provider re-opens the file by path on each call, so if the file has been truncated since, the read comes up empty and the provider returned true without writing. write_content_with_progress() advances its offset only by what was written, so it called the provider again, got nothing again, and kept spinning until the peer gave up. Return false instead, as every other failure in this provider does.